tests/basics: Split sys.exit test to separate file so it can be skipped.

pull/1/head
Damien George 2019-10-29 22:16:19 +11:00
parent 1d51115246
commit 943dd33b5f
2 changed files with 24 additions and 15 deletions

View File

@ -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)

View File

@ -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)