diff options
author | Damien George <damien.p.george@gmail.com> | 2019-10-29 22:16:19 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-10-29 22:22:37 +1100 |
commit | 943dd33b5fd36c54990ccebbd6fc30189d5373ac (patch) | |
tree | 2dd648802ac5afa79d70f23a3f4d8dbaac4090f3 | |
parent | 1d511152467ad2d21f874c9bbe05f8f117424d3e (diff) |
tests/basics: Split sys.exit test to separate file so it can be skipped.
-rw-r--r-- | tests/basics/sys1.py | 15 | ||||
-rw-r--r-- | tests/basics/sys_exit.py | 24 |
2 files changed, 24 insertions, 15 deletions
diff --git a/tests/basics/sys1.py b/tests/basics/sys1.py index 30e36f81a..ab9138024 100644 --- a/tests/basics/sys1.py +++ b/tests/basics/sys1.py @@ -18,18 +18,3 @@ try: except AttributeError: # Effectively skip subtests print(True) - -try: - raise SystemExit -except SystemExit as e: - print("SystemExit", e.args) - -try: - sys.exit() -except SystemExit as e: - print("SystemExit", e.args) - -try: - sys.exit(42) -except SystemExit as e: - print("SystemExit", e.args) diff --git a/tests/basics/sys_exit.py b/tests/basics/sys_exit.py new file mode 100644 index 000000000..b1f71549d --- /dev/null +++ b/tests/basics/sys_exit.py @@ -0,0 +1,24 @@ +# test sys module's exit function + +import sys + +try: + sys.exit +except AttributeError: + print("SKIP") + raise SystemExit + +try: + raise SystemExit +except SystemExit as e: + print("SystemExit", e.args) + +try: + sys.exit() +except SystemExit as e: + print("SystemExit", e.args) + +try: + sys.exit(42) +except SystemExit as e: + print("SystemExit", e.args) |