Skip to content
Snippets Groups Projects
Commit a2803b74 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

tests/basics: Convert "sys.exit()" to "raise SystemExit".

parent 0161939e
Branches
No related tags found
No related merge requests found
Showing
with 20 additions and 40 deletions
try: try:
import array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
a = array.array('B', [1, 2, 3]) a = array.array('B', [1, 2, 3])
print(a, len(a)) print(a, len(a))
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
import array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
a1 = array.array('I', [1]) a1 = array.array('I', [1])
a2 = array.array('I', [2]) a2 = array.array('I', [2])
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# tuple, list # tuple, list
print(array('b', (1, 2))) print(array('b', (1, 2)))
......
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# construct from something with unknown length (requires generators) # construct from something with unknown length (requires generators)
print(array('i', (i for i in range(10)))) print(array('i', (i for i in range(10))))
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# raw copy from bytes, bytearray # raw copy from bytes, bytearray
print(array('h', b'12')) print(array('h', b'12'))
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
print(array('L', [0, 2**32-1])) print(array('L', [0, 2**32-1]))
print(array('l', [-2**31, 0, 2**31-1])) print(array('l', [-2**31, 0, 2**31-1]))
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
import array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# arrays of objects # arrays of objects
a = array.array('O') a = array.array('O')
......
...@@ -8,9 +8,8 @@ t = sys.implementation ...@@ -8,9 +8,8 @@ t = sys.implementation
try: try:
t.name t.name
except AttributeError: except AttributeError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# test printing of attrtuple # test printing of attrtuple
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
delattr delattr
except: except:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
class A: pass class A: pass
a = A() a = A()
......
...@@ -4,8 +4,7 @@ try: ...@@ -4,8 +4,7 @@ try:
help help
except NameError: except NameError:
print("SKIP") print("SKIP")
import sys raise SystemExit
sys.exit()
help() # no args help() # no args
help(help) # help for a function help(help) # help for a function
......
...@@ -3,9 +3,8 @@ try: ...@@ -3,9 +3,8 @@ try:
min min
max max
except: except:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
print(min(0,1)) print(min(0,1))
print(min(1,0)) print(min(1,0))
......
...@@ -6,9 +6,8 @@ import builtins ...@@ -6,9 +6,8 @@ import builtins
try: try:
builtins.abs = lambda x: x + 1 builtins.abs = lambda x: x + 1
except AttributeError: except AttributeError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
print(abs(1)) print(abs(1))
......
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
try: try:
print(pow(3, 4, 7)) print(pow(3, 4, 7))
except NotImplementedError: except NotImplementedError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# 3 arg pow is defined to only work on integers # 3 arg pow is defined to only work on integers
try: try:
......
...@@ -4,9 +4,8 @@ ...@@ -4,9 +4,8 @@
try: try:
print(pow(3, 4, 7)) print(pow(3, 4, 7))
except NotImplementedError: except NotImplementedError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
print(pow(555557, 1000002, 1000003)) print(pow(555557, 1000002, 1000003))
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
property property
except: except:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# create a property object explicitly # create a property object explicitly
property() property()
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
try: try:
range(0).start range(0).start
except AttributeError: except AttributeError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# attrs # attrs
print(range(1, 2, 3).start) print(range(1, 2, 3).start)
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
reversed reversed
except: except:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# list # list
print(list(reversed([]))) print(list(reversed([])))
......
...@@ -3,9 +3,8 @@ try: ...@@ -3,9 +3,8 @@ try:
sorted sorted
set set
except: except:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
print(sorted(set(range(100)))) print(sorted(set(range(100))))
print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2))) print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2)))
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# arrays # arrays
print(bytearray(array('b', [1, 2]))) print(bytearray(array('b', [1, 2])))
......
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
try: try:
from array import array from array import array
except ImportError: except ImportError:
import sys
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
# arrays # arrays
print(bytearray(array('h', [1, 2]))) print(bytearray(array('h', [1, 2])))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment