From b92a8adbfa54dc259554b435a81b6cec19cae99a Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 20 Jun 2018 16:08:25 +1000 Subject: tests: Add tests using "file" argument in print and sys.print_exception. --- tests/misc/print_exception.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/misc/print_exception.py') diff --git a/tests/misc/print_exception.py b/tests/misc/print_exception.py index 9ab8e728b..f120fe1e1 100644 --- a/tests/misc/print_exception.py +++ b/tests/misc/print_exception.py @@ -56,3 +56,12 @@ try: f() except Exception as e: print_exc(e) + +# Test non-stream object passed as output object, only valid for uPy +if hasattr(sys, 'print_exception'): + try: + sys.print_exception(Exception, 1) + had_exception = False + except OSError: + had_exception = True + assert had_exception -- cgit v1.2.3