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

pull/1/head
Paul Sokolovsky 2017-06-10 20:14:16 +03:00
parent a2803b74f4
commit 85d809d1f4
88 changed files with 107 additions and 188 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,8 +4,7 @@ import os, pyb
if not 'STM32F405' in os.uname().machine: if not 'STM32F405' in os.uname().machine:
print('SKIP') print('SKIP')
import sys raise SystemExit
sys.exit()
print(pyb.freq()) print(pyb.freq())
print(type(pyb.rng())) print(type(pyb.rng()))

View File

@ -4,7 +4,6 @@ import os, pyb
if not 'STM32F411' in os.uname().machine: if not 'STM32F411' in os.uname().machine:
print('SKIP') print('SKIP')
import sys raise SystemExit
sys.exit()
print(pyb.freq()) print(pyb.freq())

View File

@ -2,8 +2,7 @@ try:
extra_coverage extra_coverage
except NameError: except NameError:
print("SKIP") print("SKIP")
import sys raise SystemExit
sys.exit()
import uerrno import uerrno
import uio import uio

View File

@ -1,9 +1,8 @@
import sys
try: try:
import ffi import ffi
except ImportError: except ImportError:
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
def ffi_open(names): def ffi_open(names):

View File

@ -1,10 +1,9 @@
# test ffi float support # test ffi float support
import sys
try: try:
import ffi import ffi
except ImportError: except ImportError:
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
def ffi_open(names): def ffi_open(names):

View File

@ -1,10 +1,9 @@
# test ffi float support # test ffi float support
import sys
try: try:
import ffi import ffi
except ImportError: except ImportError:
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
def ffi_open(names): def ffi_open(names):
@ -25,7 +24,7 @@ try:
tgammaf = libm.func('f', 'tgammaf', 'f') tgammaf = libm.func('f', 'tgammaf', 'f')
except OSError: except OSError:
print("SKIP") print("SKIP")
sys.exit() raise SystemExit
for fun in (tgammaf,): for fun in (tgammaf,):
for val in (0.5, 1, 1.0, 1.5, 4, 4.0): for val in (0.5, 1, 1.0, 1.5, 4, 4.0):