tests/basics: Split sys.exit test to separate file so it can be skipped.
This commit is contained in:
parent
1d51115246
commit
943dd33b5f
|
@ -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)
|
||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue