From 85d809d1f4e35a511e0a56b3411126e05a31c01b Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 10 Jun 2017 20:14:16 +0300 Subject: tests: Convert remaining "sys.exit()" to "raise SystemExit". --- tests/micropython/heapalloc_bytesio.py | 3 +-- tests/micropython/heapalloc_iter.py | 3 +-- tests/micropython/heapalloc_traceback.py | 3 +-- tests/micropython/heapalloc_traceback.py.exp | 2 +- tests/micropython/kbd_intr.py | 3 +-- tests/micropython/schedule.py | 3 +-- 6 files changed, 6 insertions(+), 11 deletions(-) (limited to 'tests/micropython') diff --git a/tests/micropython/heapalloc_bytesio.py b/tests/micropython/heapalloc_bytesio.py index 2a8d50abe..4aae2abf0 100644 --- a/tests/micropython/heapalloc_bytesio.py +++ b/tests/micropython/heapalloc_bytesio.py @@ -1,9 +1,8 @@ try: import uio except ImportError: - import sys print("SKIP") - sys.exit() + raise SystemExit import micropython diff --git a/tests/micropython/heapalloc_iter.py b/tests/micropython/heapalloc_iter.py index 45d3519e4..79461f999 100644 --- a/tests/micropython/heapalloc_iter.py +++ b/tests/micropython/heapalloc_iter.py @@ -2,9 +2,8 @@ try: import array except ImportError: - import sys print("SKIP") - sys.exit() + raise SystemExit try: from micropython import heap_lock, heap_unlock diff --git a/tests/micropython/heapalloc_traceback.py b/tests/micropython/heapalloc_traceback.py index b3795293f..f4212b6ce 100644 --- a/tests/micropython/heapalloc_traceback.py +++ b/tests/micropython/heapalloc_traceback.py @@ -5,9 +5,8 @@ import sys try: import uio except ImportError: - import sys print("SKIP") - sys.exit() + raise SystemExit # preallocate exception instance with some room for a traceback global_exc = StopIteration() diff --git a/tests/micropython/heapalloc_traceback.py.exp b/tests/micropython/heapalloc_traceback.py.exp index facd0af13..291bbd697 100644 --- a/tests/micropython/heapalloc_traceback.py.exp +++ b/tests/micropython/heapalloc_traceback.py.exp @@ -1,5 +1,5 @@ StopIteration Traceback (most recent call last): - File , line 23, in test + File , line 22, in test StopIteration: diff --git a/tests/micropython/kbd_intr.py b/tests/micropython/kbd_intr.py index a7ce7464b..879c9a229 100644 --- a/tests/micropython/kbd_intr.py +++ b/tests/micropython/kbd_intr.py @@ -6,8 +6,7 @@ try: micropython.kbd_intr except AttributeError: print('SKIP') - import sys - sys.exit() + raise SystemExit # just check we can actually call it micropython.kbd_intr(3) diff --git a/tests/micropython/schedule.py b/tests/micropython/schedule.py index 3d584eea4..74f90cb2d 100644 --- a/tests/micropython/schedule.py +++ b/tests/micropython/schedule.py @@ -6,8 +6,7 @@ try: micropython.schedule except AttributeError: print('SKIP') - import sys - sys.exit() + raise SystemExit # Basic test of scheduling a function. -- cgit v1.2.3