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

This commit is contained in:
Paul Sokolovsky
2017-06-10 20:03:01 +03:00
parent 0161939ed1
commit a2803b74f4
69 changed files with 69 additions and 137 deletions
+1 -2
View File
@@ -1,9 +1,8 @@
try:
import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
a = array.array('B', [1, 2, 3])
print(a, len(a))
+1 -2
View File
@@ -2,9 +2,8 @@
try:
import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
a1 = array.array('I', [1])
a2 = array.array('I', [2])
+1 -2
View File
@@ -3,9 +3,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# tuple, list
print(array('b', (1, 2)))
+1 -2
View File
@@ -1,9 +1,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# construct from something with unknown length (requires generators)
print(array('i', (i for i in range(10))))
+1 -2
View File
@@ -3,9 +3,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# raw copy from bytes, bytearray
print(array('h', b'12'))
+1 -2
View File
@@ -3,9 +3,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(array('L', [0, 2**32-1]))
print(array('l', [-2**31, 0, 2**31-1]))
+1 -2
View File
@@ -2,9 +2,8 @@
try:
import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# arrays of objects
a = array.array('O')
+1 -2
View File
@@ -8,9 +8,8 @@ t = sys.implementation
try:
t.name
except AttributeError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# test printing of attrtuple
+1 -2
View File
@@ -2,9 +2,8 @@
try:
delattr
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
class A: pass
a = A()
+1 -2
View File
@@ -4,8 +4,7 @@ try:
help
except NameError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
help() # no args
help(help) # help for a function
+1 -2
View File
@@ -3,9 +3,8 @@ try:
min
max
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(min(0,1))
print(min(1,0))
+1 -2
View File
@@ -6,9 +6,8 @@ import builtins
try:
builtins.abs = lambda x: x + 1
except AttributeError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(abs(1))
+1 -2
View File
@@ -4,9 +4,8 @@
try:
print(pow(3, 4, 7))
except NotImplementedError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# 3 arg pow is defined to only work on integers
try:
+1 -2
View File
@@ -4,9 +4,8 @@
try:
print(pow(3, 4, 7))
except NotImplementedError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(pow(555557, 1000002, 1000003))
+1 -2
View File
@@ -2,9 +2,8 @@
try:
property
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# create a property object explicitly
property()
+1 -2
View File
@@ -3,9 +3,8 @@
try:
range(0).start
except AttributeError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# attrs
print(range(1, 2, 3).start)
+1 -2
View File
@@ -2,9 +2,8 @@
try:
reversed
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# list
print(list(reversed([])))
+1 -2
View File
@@ -3,9 +3,8 @@ try:
sorted
set
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(sorted(set(range(100))))
print(sorted(set(range(100)), key=lambda x: x + 100*(x % 2)))
+1 -2
View File
@@ -2,9 +2,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# arrays
print(bytearray(array('b', [1, 2])))
+1 -2
View File
@@ -2,9 +2,8 @@
try:
from array import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# arrays
print(bytearray(array('h', [1, 2])))

Some files were not shown because too many files have changed in this diff Show More