diff options
| author | Diego Elio Pettenò <flameeyes@flameeyes.com> | 2020-05-30 10:44:13 +0100 |
|---|---|---|
| committer | Diego Elio Pettenò <flameeyes@flameeyes.com> | 2020-06-03 10:56:35 +0100 |
| commit | dd5d7c86d22807c021dd1711eb7dd3daebc5cfcf (patch) | |
| tree | dde417af2cae8cb1797582d6489eab9cb9caeddf /tests | |
| parent | 60df6170cc5d0e495fde9613c05c55b64189b425 (diff) | |
Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
Diffstat (limited to 'tests')
39 files changed, 44 insertions, 66 deletions
diff --git a/tests/basics/assign1.py b/tests/basics/assign1.py index 118747f74..01047fa92 100644 --- a/tests/basics/assign1.py +++ b/tests/basics/assign1.py @@ -8,4 +8,3 @@ print(a, b) a = b = c = 3 print(a, b, c) - diff --git a/tests/basics/builtin_chr.py b/tests/basics/builtin_chr.py index 02d783ae6..c1a9f7053 100644 --- a/tests/basics/builtin_chr.py +++ b/tests/basics/builtin_chr.py @@ -6,4 +6,3 @@ try: chr(0x110000) except ValueError: print("ValueError") - diff --git a/tests/basics/dict_popitem.py b/tests/basics/dict_popitem.py index e37bcec19..0e3384253 100644 --- a/tests/basics/dict_popitem.py +++ b/tests/basics/dict_popitem.py @@ -13,4 +13,3 @@ except KeyError: else: print("Did not raise KeyError") print(sorted(els)) - diff --git a/tests/basics/dict_setdefault.py b/tests/basics/dict_setdefault.py index 57d0ba451..87de5b3af 100644 --- a/tests/basics/dict_setdefault.py +++ b/tests/basics/dict_setdefault.py @@ -9,5 +9,3 @@ d.pop(5) print(d.setdefault(5, 1)) print(d[1]) print(d[5]) - - diff --git a/tests/basics/gen_yield_from_throw.py b/tests/basics/gen_yield_from_throw.py index 829bf0f3b..d6754d5cd 100644 --- a/tests/basics/gen_yield_from_throw.py +++ b/tests/basics/gen_yield_from_throw.py @@ -21,7 +21,7 @@ except TypeError: def gen3(): yield 123 yield 456 - + g3 = gen3() print(next(g3)) try: diff --git a/tests/basics/gen_yield_from_throw2.py b/tests/basics/gen_yield_from_throw2.py index 0abfdd8cc..5c0fc7dbc 100644 --- a/tests/basics/gen_yield_from_throw2.py +++ b/tests/basics/gen_yield_from_throw2.py @@ -6,7 +6,7 @@ def gen(): except GeneratorExit: print('GeneratorExit') yield 456 - + # thrown a class g = gen() print(next(g)) diff --git a/tests/basics/int_big_and2.py b/tests/basics/int_big_and2.py index f8c81fe0c..045a90ef7 100644 --- a/tests/basics/int_big_and2.py +++ b/tests/basics/int_big_and2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_and3.py b/tests/basics/int_big_and3.py index 788ecd823..7a3b415af 100644 --- a/tests/basics/int_big_and3.py +++ b/tests/basics/int_big_and3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 & 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 & 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 & -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or.py b/tests/basics/int_big_or.py index 17d993526..ccded3778 100644 --- a/tests/basics/int_big_or.py +++ b/tests/basics/int_big_or.py @@ -3,7 +3,7 @@ print(0 | (1 << 80)) a = 0xfffffffffffffffffffffffffffff print(a | (1 << 200)) -# test + + +# test + + print(0 | (1 << 80)) print((1 << 80) | (1 << 80)) @@ -15,7 +15,7 @@ print(a | (1 << 200)) print(a | a == 0) print(bool(a | a)) -# test - + +# test - + print((-1 << 80) | (1 << 80)) print((-1 << 80) | 0) @@ -25,7 +25,7 @@ print((-a) | (1 << 200)) print((-a) | a == 0) print(bool((-a) | a)) -# test + - +# test + - print(0 | (-1 << 80)) print((1 << 80) | (-1 << 80)) @@ -35,7 +35,7 @@ print(a | (-1 << 200)) print(a | (-a) == 0) print(bool(a | (-a))) -# test - - +# test - - print((-1 << 80) | (-1 << 80)) diff --git a/tests/basics/int_big_or2.py b/tests/basics/int_big_or2.py index 255495150..92d76c770 100644 --- a/tests/basics/int_big_or2.py +++ b/tests/basics/int_big_or2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -23,7 +23,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_or3.py b/tests/basics/int_big_or3.py index 07edaea2d..212b3da8a 100644 --- a/tests/basics/int_big_or3.py +++ b/tests/basics/int_big_or3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 | 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 | 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 | -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor.py b/tests/basics/int_big_xor.py index cd1d9ae97..28b191d3d 100644 --- a/tests/basics/int_big_xor.py +++ b/tests/basics/int_big_xor.py @@ -1,4 +1,4 @@ -# test + + +# test + + print(0 ^ (1 << 80)) print((1 << 80) ^ (1 << 80)) @@ -10,7 +10,7 @@ print(a ^ (1 << 200)) print(a ^ a == 0) print(bool(a ^ a)) -# test - + +# test - + print((-1 << 80) ^ (1 << 80)) print((-1 << 80) ^ 0) @@ -22,7 +22,7 @@ print(bool((-a) ^ a)) i = -1 print(i ^ 0xffffffffffffffff) # carry overflows to higher digit -# test + - +# test + - print(0 ^ (-1 << 80)) print((1 << 80) ^ (-1 << 80)) @@ -32,7 +32,7 @@ print(a ^ (-1 << 200)) print(a ^ (-a) == 0) print(bool(a ^ (-a))) -# test - - +# test - - print((-1 << 80) ^ (-1 << 80)) diff --git a/tests/basics/int_big_xor2.py b/tests/basics/int_big_xor2.py index b5b3db60c..21ef842f8 100644 --- a/tests/basics/int_big_xor2.py +++ b/tests/basics/int_big_xor2.py @@ -1,4 +1,4 @@ -# test + + +# test + + print( 97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( 283894311 print( 40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test - - +# test - - print( -97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/int_big_xor3.py b/tests/basics/int_big_xor3.py index 00881e374..ff5e9aeff 100644 --- a/tests/basics/int_big_xor3.py +++ b/tests/basics/int_big_xor3.py @@ -1,4 +1,4 @@ -# test - + +# test - + print( -97989513389222316022151446562729620153292831887555425160965597396 ^ 23716683549865351578586448630079789776107310103486834795830390982) @@ -24,7 +24,7 @@ print( -283894311 print( -40019818573920230246248826511203818792007462193311949166285967147 ^ 9487909752) -# test + - +# test + - print( 97989513389222316022151446562729620153292831887555425160965597396 ^ -23716683549865351578586448630079789776107310103486834795830390982) diff --git a/tests/basics/set_iter.py b/tests/basics/set_iter.py index 296017730..e7da28e1b 100644 --- a/tests/basics/set_iter.py +++ b/tests/basics/set_iter.py @@ -2,4 +2,3 @@ s = {1, 2, 3, 4} l = list(s) l.sort() print(l) - diff --git a/tests/basics/string_cr_conversion.py b/tests/basics/string_cr_conversion.py index 0c3ba16b8..b8ec7e825 100644 --- a/tests/basics/string_cr_conversion.py +++ b/tests/basics/string_cr_conversion.py @@ -1 +1 @@ -# this file has CR line endings to test lexer's conversion of them to LF
# in triple quoted strings
print(repr("""abc
def"""))
\ No newline at end of file +# this file has CR line endings to test lexer's conversion of them to LF
# in triple quoted strings
print(repr("""abc
def""")) diff --git a/tests/basics/subscr_tuple.py b/tests/basics/subscr_tuple.py index 85d25366d..0210e24df 100644 --- a/tests/basics/subscr_tuple.py +++ b/tests/basics/subscr_tuple.py @@ -4,4 +4,3 @@ class Foo(tuple): foo = Foo((1,2)) foo[0] - diff --git a/tests/extmod/uctypes_array_assign_le.py b/tests/extmod/uctypes_array_assign_le.py index 6afa7e0a2..37c52388d 100644 --- a/tests/extmod/uctypes_array_assign_le.py +++ b/tests/extmod/uctypes_array_assign_le.py @@ -55,4 +55,3 @@ assert hex(S.arr6[0]) == "0xaabbccdd" print(S.arr6[0] == S.arr8[0].l) assert S.arr6[0] == S.arr8[0].l - diff --git a/tests/extmod/uctypes_byteat.py b/tests/extmod/uctypes_byteat.py index ab2535db8..784209f80 100644 --- a/tests/extmod/uctypes_byteat.py +++ b/tests/extmod/uctypes_byteat.py @@ -6,5 +6,5 @@ except ImportError: data = bytearray(b'01234567') -print(uctypes.bytes_at(uctypes.addressof(data), 4)) -print(uctypes.bytearray_at(uctypes.addressof(data), 4)) +print(uctypes.bytes_at(uctypes.addressof(data), 4)) +print(uctypes.bytearray_at(uctypes.addressof(data), 4)) diff --git a/tests/extmod/uctypes_error.py b/tests/extmod/uctypes_error.py index 95ba0fad4..2500e2927 100644 --- a/tests/extmod/uctypes_error.py +++ b/tests/extmod/uctypes_error.py @@ -9,29 +9,29 @@ except ImportError: data = bytearray(b"01234567") # del subscr not supported -S = uctypes.struct(uctypes.addressof(data), {}) +S = uctypes.struct(uctypes.addressof(data), {}) try: del S[0] except TypeError: print('TypeError') # list is an invalid descriptor -S = uctypes.struct(uctypes.addressof(data), []) +S = uctypes.struct(uctypes.addressof(data), []) try: - S.x + S.x except TypeError: print('TypeError') # can't access attribute with invalid descriptor S = uctypes.struct(uctypes.addressof(data), {'x':[]}) try: - S.x + S.x except TypeError: print('TypeError') # can't assign to aggregate S = uctypes.struct(uctypes.addressof(data), {'x':(uctypes.ARRAY | 0, uctypes.INT8 | 2)}) try: - S.x = 1 + S.x = 1 except TypeError: print('TypeError') diff --git a/tests/extmod/ujson_dump_iobase.py b/tests/extmod/ujson_dump_iobase.py index d30d1b561..6280fb11b 100644 --- a/tests/extmod/ujson_dump_iobase.py +++ b/tests/extmod/ujson_dump_iobase.py @@ -28,5 +28,5 @@ class S(io.IOBase): # dump to the user stream s = S() -json.dump([123, {}], s) +json.dump([123, {}], s) print(s.buf) diff --git a/tests/extmod/ure_sub.py b/tests/extmod/ure_sub.py index 4aeb8650a..f5a19af8d 100644 --- a/tests/extmod/ure_sub.py +++ b/tests/extmod/ure_sub.py @@ -27,11 +27,11 @@ print(re.sub('a', A(), 'aBCBABCDabcda.')) print( re.sub( - r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', - 'static PyObject*\npy_\\1(void){\n return;\n}\n', + r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', + 'static PyObject*\npy_\\1(void){\n return;\n}\n', '\n\ndef myfunc():\n\ndef myfunc1():\n\ndef myfunc2():' ) -) +) print( re.compile( diff --git a/tests/feature_check/complex.py b/tests/feature_check/complex.py index a22eb52ce..7576dcb95 100644 --- a/tests/feature_check/complex.py +++ b/tests/feature_check/complex.py @@ -3,4 +3,3 @@ try: print("complex") except NameError: print("no") - diff --git a/tests/float/builtin_float_minmax.py b/tests/float/builtin_float_minmax.py index 266ed133d..8a53746e5 100644 --- a/tests/float/builtin_float_minmax.py +++ b/tests/float/builtin_float_minmax.py @@ -29,4 +29,3 @@ print(min([1, 2.9, 4, 6.5, -1, 2])) print(max([1, 2.9, 4, 6.5, -1, 2])) print(min([1, 2.9, 4, -6.5, -1, 2])) print(max([1, 2.9, 4, -6.5, -1, 2])) - diff --git a/tests/float/float_struct.py b/tests/float/float_struct.py index c4c186b89..dd7a418ad 100644 --- a/tests/float/float_struct.py +++ b/tests/float/float_struct.py @@ -15,4 +15,3 @@ for fmt in ('f', 'd', '>f', '>d', '<f', '<d'): x = struct.pack(fmt, i) v = struct.unpack(fmt, x)[0] print('%2s: %.17f - %s' % (fmt, v, (i == v) and 'passed' or 'failed')) - diff --git a/tests/float/math_fun_bool.py b/tests/float/math_fun_bool.py index 30ab14a52..761871b41 100644 --- a/tests/float/math_fun_bool.py +++ b/tests/float/math_fun_bool.py @@ -6,7 +6,7 @@ except ImportError: print("SKIP") raise SystemExit -test_values = [1, 0, -1, 1.0, 0.0, -1.0, float('NaN'), float('Inf'), +test_values = [1, 0, -1, 1.0, 0.0, -1.0, float('NaN'), float('Inf'), -float('NaN'), -float('Inf')] functions = [isfinite, isnan, isinf] diff --git a/tests/inlineasm/asmfpaddsub.py b/tests/inlineasm/asmfpaddsub.py index b5fcecb6c..2bdfccf0e 100644 --- a/tests/inlineasm/asmfpaddsub.py +++ b/tests/inlineasm/asmfpaddsub.py @@ -12,4 +12,3 @@ def add_sub(r0, r1, r2): vmov(r0, s31) print(add_sub(100, 20, 30)) - diff --git a/tests/inlineasm/asmfpldrstr.py b/tests/inlineasm/asmfpldrstr.py index 8fa9af636..4c480671f 100644 --- a/tests/inlineasm/asmfpldrstr.py +++ b/tests/inlineasm/asmfpldrstr.py @@ -9,4 +9,3 @@ def arrayadd(r0): z = array.array("f", [2, 4, 10]) arrayadd(z) print(z[2]) - diff --git a/tests/inlineasm/asmfpmuldiv.py b/tests/inlineasm/asmfpmuldiv.py index edf9511bc..043a28e22 100644 --- a/tests/inlineasm/asmfpmuldiv.py +++ b/tests/inlineasm/asmfpmuldiv.py @@ -12,4 +12,3 @@ def muldiv(r0, r1, r2): vmov(r0, s31) print(muldiv(100, 10, 50)) - diff --git a/tests/inlineasm/asmfpsqrt.py b/tests/inlineasm/asmfpsqrt.py index f2c2d3a95..7b7d52e23 100644 --- a/tests/inlineasm/asmfpsqrt.py +++ b/tests/inlineasm/asmfpsqrt.py @@ -12,4 +12,3 @@ def sqrt_test(r0, r1): vmov(r0, s31) print(sqrt_test(256, 10)) - diff --git a/tests/inlineasm/asmspecialregs.py b/tests/inlineasm/asmspecialregs.py index edfe4c2bd..2d3b0e396 100644 --- a/tests/inlineasm/asmspecialregs.py +++ b/tests/inlineasm/asmspecialregs.py @@ -8,4 +8,3 @@ def getBASEPRI(): print(getBASEPRI()) print(getIPSR()) - diff --git a/tests/jni/README b/tests/jni/README index 8418bb84f..a0689e924 100644 --- a/tests/jni/README +++ b/tests/jni/README @@ -9,4 +9,3 @@ of JVM. For example, for OpenJDK 7 on x86_64, following may work: LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server ./run-tests jni/*.py - diff --git a/tests/misc/features.py b/tests/misc/features.py index 3efb476ab..de75cb46d 100644 --- a/tests/misc/features.py +++ b/tests/misc/features.py @@ -25,7 +25,7 @@ print(ten()) a=[] for i in range(13): a.append(i) -print(a[11]) +print(a[11]) print(a[-1]) str="0123456789" print(str[1]+str[3]) @@ -73,13 +73,13 @@ while True: try: def gcheck(): global a - print(a) + print(a) gcheck() class c25(): x=25 x=c25() print(x.x) - raise + raise except: print(26) print(27+zero) diff --git a/tests/thread/mutate_bytearray.py b/tests/thread/mutate_bytearray.py index f3276f1b2..f91b2d580 100644 --- a/tests/thread/mutate_bytearray.py +++ b/tests/thread/mutate_bytearray.py @@ -42,4 +42,3 @@ count = [0 for _ in range(256)] for b in ba: count[b] += 1 print(count) - diff --git a/tests/wipy/i2c.py b/tests/wipy/i2c.py index 693155419..39dcdc722 100644 --- a/tests/wipy/i2c.py +++ b/tests/wipy/i2c.py @@ -173,4 +173,3 @@ except Exception: # reinitialization must work i2c.init(baudrate=400000) print(i2c) - diff --git a/tests/wipy/pin.py b/tests/wipy/pin.py index 22c7c6176..666ecb66b 100644 --- a/tests/wipy/pin.py +++ b/tests/wipy/pin.py @@ -1,7 +1,7 @@ -""" -This test need a set of pins which can be set as inputs and have no external +""" +This test need a set of pins which can be set as inputs and have no external pull up or pull down connected. -GP12 and GP17 must be connected together +GP12 and GP17 must be connected together """ from machine import Pin import os @@ -179,4 +179,3 @@ try: pin.id('ABC') # id cannot be set except Exception: print('Exception') - diff --git a/tests/wipy/sd.py b/tests/wipy/sd.py index 92746e01e..c946e0c9f 100644 --- a/tests/wipy/sd.py +++ b/tests/wipy/sd.py @@ -43,4 +43,3 @@ try: sd = SD(pins=('GP10', 'GP11')) except Exception: print("Exception") - diff --git a/tests/wipy/uart.py b/tests/wipy/uart.py index 8e794015d..d8b405f77 100644 --- a/tests/wipy/uart.py +++ b/tests/wipy/uart.py @@ -1,5 +1,5 @@ ''' -UART test for the CC3200 based boards. +UART test for the CC3200 based boards. UART0 and UART1 must be connected together for this test to pass. ''' @@ -58,7 +58,7 @@ print(uart0.read() == None) uart0.write(b'123') buf = bytearray(3) -print(uart1.readinto(buf, 1) == 1) +print(uart1.readinto(buf, 1) == 1) print(buf) print(uart1.readinto(buf) == 2) print(buf) @@ -145,7 +145,7 @@ except Exception: try: UART(2, 9600) except Exception: - print('Exception') + print('Exception') for uart_id in uart_id_range: uart = UART(uart_id, 1000000) diff --git a/tests/wipy/wlan/wlan.py b/tests/wipy/wlan/wlan.py index 49e2e4af6..96121325c 100644 --- a/tests/wipy/wlan/wlan.py +++ b/tests/wipy/wlan/wlan.py @@ -179,4 +179,3 @@ try: wifi.ifconfig(config=()) except: print('Exception') - |
