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

crypto-aes
Paul Sokolovsky 6 years ago
parent a2803b74f4
commit 85d809d1f4

@ -4,8 +4,7 @@ try:
import uerrno
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
#f = open("_test.db", "w+b")
f = uio.BytesIO()

@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
w = 5
h = 16

@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
def printbuf():
print("--8<--")

@ -2,8 +2,7 @@ try:
import framebuf
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
def printbuf():
print("--8<--")

@ -8,8 +8,7 @@ try:
machine.mem8
except:
print("SKIP")
import sys
sys.exit()
raise SystemExit
print(machine.mem8)

@ -6,8 +6,7 @@ try:
machine.PinBase
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class MyPin(machine.PinBase):

@ -7,8 +7,7 @@ try:
machine.time_pulse_us
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class ConstPin(machine.PinBase):

@ -9,8 +9,7 @@ try:
machine.Signal
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
class Pin(machine.PinBase):
def __init__(self):

@ -1,10 +1,9 @@
import sys
import utime
try:
utime.sleep_ms
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
utime.sleep_ms(1)
utime.sleep_us(1)

@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.a2b_base64(b''))
print(binascii.a2b_base64(b'Zg=='))

@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.b2a_base64(b''))
print(binascii.b2a_base64(b'f'))

@ -4,16 +4,14 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
try:
binascii.crc32
except AttributeError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
print(hex(binascii.crc32(b'The quick brown fox jumps over the lazy dog')))
print(hex(binascii.crc32(b'\x00' * 32)))

@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.hexlify(b'\x00\x01\x02\x03\x04\x05\x06\x07'))
print(binascii.hexlify(b'\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'))

@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# two arguments supported in uPy but not CPython
a = binascii.hexlify(b'123', ':')

@ -4,9 +4,8 @@ try:
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(binascii.unhexlify(b'0001020304050607'))
print(binascii.unhexlify(b'08090a0b0c0d0e0f'))

@ -3,9 +3,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
buf = b"12345678abcd"
struct = uctypes.struct(

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2

@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2

@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"arr": (uctypes.ARRAY | 0, uctypes.UINT8 | 2),

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"s0": uctypes.UINT16 | 0,

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"f32": uctypes.FLOAT32 | 0,

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"f32": uctypes.FLOAT32 | 0,

@ -6,11 +6,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {

@ -2,9 +2,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# we use an address of "0" because we just want to print something deterministic
# and don't actually need to set/get any values in the struct

@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {
"ptr": (uctypes.PTR | 0, uctypes.UINT8),

@ -3,11 +3,11 @@ try:
import uctypes
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if sys.byteorder != "little":
print("SKIP")
sys.exit()
raise SystemExit
desc = {

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
desc = {
# arr is array at offset 0, of UINT8 elements, array size is 2

@ -1,9 +1,8 @@
try:
import uctypes
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
S1 = {}
assert uctypes.sizeof(S1) == 0

@ -1,4 +1,3 @@
import sys
try:
import uhashlib as hashlib
except ImportError:
@ -8,14 +7,14 @@ except ImportError:
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
sys.exit()
raise SystemExit
try:
hashlib.sha1
except AttributeError:
# SHA1 is only available on some ports
print("SKIP")
sys.exit()
raise SystemExit
sha1 = hashlib.sha1(b'hello')
sha1.update(b'world')

@ -1,4 +1,3 @@
import sys
try:
import uhashlib as hashlib
except ImportError:
@ -8,7 +7,7 @@ except ImportError:
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
sys.exit()
raise SystemExit
h = hashlib.sha256()

@ -4,9 +4,8 @@ except:
try:
import heapq
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
try:
heapq.heappop([])

@ -4,9 +4,8 @@ except ImportError:
try:
import json
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(json.dumps(False))
print(json.dumps(True))

@ -3,8 +3,7 @@
try:
import ujson
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(ujson.dumps(b'1234'))

@ -4,8 +4,7 @@ except ImportError:
try:
import json
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(json.dumps(1.2))

@ -6,9 +6,8 @@ except:
from io import StringIO
import json
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
print(json.load(StringIO('null')))
print(json.load(StringIO('"abc\\u0064e"')))

@ -4,9 +4,8 @@ except ImportError:
try:
import json
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
def my_print(o):
if isinstance(o, dict):

@ -4,9 +4,8 @@ except ImportError:
try:
import json
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
def my_print(o):
print('%.3f' % o)

@ -4,9 +4,8 @@ except ImportError:
try:
import random
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# check getrandbits returns a value within the bit range
for b in (1, 2, 3, 4, 16, 32):

@ -4,16 +4,14 @@ except ImportError:
try:
import random
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
try:
random.randint
except AttributeError:
import sys
print('SKIP')
sys.exit()
raise SystemExit
print('randrange')
for i in range(50):

@ -4,9 +4,8 @@ except ImportError:
try:
import re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
r = re.compile(".+")
m = r.match("abc")

@ -2,8 +2,7 @@
try:
import ure
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
ure.compile('^a|b[0-9]\w$', ure.DEBUG)

@ -6,9 +6,8 @@ except ImportError:
try:
import re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
def test_re(r):
try:

@ -6,9 +6,8 @@ except ImportError:
try:
import re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
def print_groups(match):
print('----')

@ -6,9 +6,8 @@ except ImportError:
try:
import re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
def print_groups(match):
print('----')

@ -4,9 +4,8 @@ except ImportError:
try:
import re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
r = re.compile(" ")
s = r.split("a b c foobar")

@ -7,9 +7,8 @@
try:
import ure as re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
r = re.compile(" *")
s = r.split("a b c foobar")

@ -1,9 +1,8 @@
try:
import ure as re
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
r = re.compile('( )')
try:

@ -5,8 +5,7 @@ try:
import ussl as ssl
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
# create in client mode
try:

@ -5,8 +5,7 @@ try:
from utimeq import utimeq
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
DEBUG = 0

@ -2,8 +2,7 @@ try:
from utimeq import utimeq
except ImportError:
print("SKIP")
import sys
sys.exit()
raise SystemExit
h = utimeq(10)

@ -2,9 +2,8 @@ try:
import uzlib as zlib
import uio as io
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# Raw DEFLATE bitstream

@ -2,9 +2,8 @@ try:
import uzlib as zlib
import uio as io
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# gzip bitstream

@ -4,9 +4,8 @@ except ImportError:
try:
import uzlib as zlib
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
PATTERNS = [
# Packed results produced by CPy's zlib.compress()

@ -9,8 +9,7 @@ try:
uos.mount
except (ImportError, AttributeError):
print("SKIP")
import sys
sys.exit()
raise SystemExit
class Filesystem:

@ -1,4 +1,3 @@
import sys
try:
import uerrno
try:
@ -8,13 +7,13 @@ try:
import uos
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
class RAMFS:
@ -46,7 +45,7 @@ try:
bdev = RAMFS(50)
except MemoryError:
print("SKIP")
sys.exit()
raise SystemExit
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev)

@ -1,4 +1,3 @@
import sys
try:
import uerrno
try:
@ -8,13 +7,13 @@ try:
import uos
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
class RAMFS:
@ -46,7 +45,7 @@ try:
bdev = RAMFS(50)
except MemoryError:
print("SKIP")
sys.exit()
raise SystemExit
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev)

@ -1,4 +1,3 @@
import sys
import uerrno
try:
try:
@ -8,13 +7,13 @@ try:
import uos
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
class RAMFS:
@ -47,7 +46,7 @@ try:
bdev2 = RAMFS(50)
except MemoryError:
print("SKIP")
sys.exit()
raise SystemExit
# first we umount any existing mount points the target may have
try:

@ -1,4 +1,3 @@
import sys
try:
import uerrno
try:
@ -7,13 +6,13 @@ try:
import uos
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
class RAMFS_OLD:
@ -43,7 +42,7 @@ try:
bdev = RAMFS_OLD(50)
except MemoryError:
print("SKIP")
sys.exit()
raise SystemExit
uos.VfsFat.mkfs(bdev)
vfs = uos.VfsFat(bdev)

@ -1,4 +1,3 @@
import sys
try:
import uerrno
try:
@ -7,13 +6,13 @@ try:
import uos
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
try:
uos.VfsFat
except AttributeError:
print("SKIP")
sys.exit()
raise SystemExit
class RAMFS:
@ -45,7 +44,7 @@ try:
bdev = RAMFS(50)
except MemoryError:
print("SKIP")
sys.exit()
raise SystemExit
uos.VfsFat.mkfs(bdev)

@ -3,9 +3,8 @@ try:
import uerrno
import websocket
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# put raw data in the stream and do a websocket read
def ws_read(msg, sz):

@ -4,9 +4,8 @@ try:
io.BytesIO
io.BufferedWriter
except AttributeError:
import sys
print('SKIP')
sys.exit()
raise SystemExit
bts = io.BytesIO()
buf = io.BufferedWriter(bts, 8)

@ -1,4 +1,3 @@
import sys
try:
import uos as os
except ImportError:
@ -6,7 +5,7 @@ except ImportError:
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
raise SystemExit
# cleanup in case testfile exists
try:

@ -1,4 +1,3 @@
import sys
try:
import uos as os
except ImportError:
@ -6,7 +5,7 @@ except ImportError:
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
raise SystemExit
# cleanup in case testfile exists
try:

@ -5,7 +5,7 @@ try:
uio.resource_stream
except AttributeError:
print('SKIP')
sys.exit()
raise SystemExit
buf = uio.resource_stream("data", "file2")
print(buf.read())

@ -5,9 +5,8 @@ import uio
try:
uio.BytesIO
except AttributeError:
import sys
print('SKIP')
sys.exit()
raise SystemExit
buf = uio.BytesIO()

@ -1,10 +1,9 @@
import sys
import jni
try:
ArrayList = jni.cls("java/util/ArrayList")
except:
print("SKIP")
sys.exit()
raise SystemExit
l = ArrayList()
print(l)

@ -1,10 +1,9 @@
import sys
import jni
try:
Integer = jni.cls("java/lang/Integer")
except:
print("SKIP")
sys.exit()
raise SystemExit
# Create object
i = Integer(42)

@ -1,9 +1,8 @@
import sys
try:
import jni
System = jni.cls("java/lang/System")
except:
print("SKIP")
sys.exit()
raise SystemExit
System.out.println("Hello, Java!")

@ -1,9 +1,8 @@
try:
import uio
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
import micropython

@ -2,9 +2,8 @@
try:
import array
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
try:
from micropython import heap_lock, heap_unlock

@ -5,9 +5,8 @@ import sys
try:
import uio
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# preallocate exception instance with some room for a traceback
global_exc = StopIteration()

@ -1,5 +1,5 @@
StopIteration
Traceback (most recent call last):
File , line 23, in test
File , line 22, in test
StopIteration:

@ -6,8 +6,7 @@ try:
micropython.kbd_intr
except AttributeError:
print('SKIP')
import sys
sys.exit()
raise SystemExit
# just check we can actually call it
micropython.kbd_intr(3)

@ -6,8 +6,7 @@ try:
micropython.schedule
except AttributeError:
print('SKIP')
import sys
sys.exit()
raise SystemExit
# Basic test of scheduling a function.

@ -4,9 +4,8 @@ try:
import array
import ustruct
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# when super can't find self
try:

@ -6,7 +6,7 @@ try:
import io
except ImportError:
print("SKIP")
sys.exit()
raise SystemExit
if hasattr(sys, 'print_exception'):
print_exception = sys.print_exception

@ -2,9 +2,8 @@
try:
import uio as io
except ImportError:
import sys
print("SKIP")
sys.exit()
raise SystemExit
l = [1, 2, 3, None]
l[-1] = l

@ -6,9 +6,8 @@ try:
max
zip
except:
import sys
print("SKIP")
sys.exit()
raise SystemExit
# We need to pick an N that is large enough to hit the recursion
# limit, but not too large that we run out of heap memory.

@ -3,7 +3,7 @@ try:
sys.exc_info
except:
print("SKIP")
sys.exit()
raise SystemExit
def f():
print(sys.exc_info()[0:2])

@ -2,8 +2,7 @@ try:
from pyb import CAN
except ImportError:
print('SKIP')
import sys
sys.exit()
raise SystemExit
import pyb

@ -2,8 +2,7 @@ import pyb
if not hasattr(pyb, 'DAC'):
print('SKIP')
import sys
sys.exit()
raise SystemExit
dac = pyb.DAC(1)
print(dac)

@ -4,8 +4,7 @@ import os, pyb
if not 'STM32F405' in os.uname().machine:
print('SKIP')