summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cpydiff/core_fstring_parser.py4
-rw-r--r--tests/extmod/deflate_compress_memory_error.py2
-rw-r--r--tests/extmod/json_loads.py2
-rw-r--r--tests/extmod/json_loads_int_64.py2
-rw-r--r--tests/extmod/tls_dtls.py2
-rw-r--r--tests/float/math_fun_special.py2
-rw-r--r--tests/import/import_star.py32
-rw-r--r--tests/import/pkgstar_all_array/__init__.py2
-rw-r--r--tests/import/pkgstar_all_miss/__init__.py2
-rw-r--r--tests/import/pkgstar_all_tuple/__init__.py2
-rwxr-xr-xtests/run-tests.py4
11 files changed, 28 insertions, 28 deletions
diff --git a/tests/cpydiff/core_fstring_parser.py b/tests/cpydiff/core_fstring_parser.py
index 570b92434..04b24cdfb 100644
--- a/tests/cpydiff/core_fstring_parser.py
+++ b/tests/cpydiff/core_fstring_parser.py
@@ -5,5 +5,5 @@ cause: MicroPython is optimised for code space.
workaround: Always use balanced braces and brackets in expressions inside f-strings
"""
-print(f'{"hello { world"}')
-print(f'{"hello ] world"}')
+print(f"{'hello { world'}")
+print(f"{'hello ] world'}")
diff --git a/tests/extmod/deflate_compress_memory_error.py b/tests/extmod/deflate_compress_memory_error.py
index 56ce06030..19bef87bf 100644
--- a/tests/extmod/deflate_compress_memory_error.py
+++ b/tests/extmod/deflate_compress_memory_error.py
@@ -28,7 +28,7 @@ l.pop()
# Try to compress. This will try to allocate a large window and fail.
try:
- g.write('test')
+ g.write("test")
except MemoryError:
print("MemoryError")
diff --git a/tests/extmod/json_loads.py b/tests/extmod/json_loads.py
index 095e67d74..092402d71 100644
--- a/tests/extmod/json_loads.py
+++ b/tests/extmod/json_loads.py
@@ -86,7 +86,7 @@ except ValueError:
# incomplete array declaration
try:
- my_print(json.loads('[0,'))
+ my_print(json.loads("[0,"))
except ValueError:
print("ValueError")
diff --git a/tests/extmod/json_loads_int_64.py b/tests/extmod/json_loads_int_64.py
index 193a3c28d..f6236f190 100644
--- a/tests/extmod/json_loads_int_64.py
+++ b/tests/extmod/json_loads_int_64.py
@@ -13,4 +13,4 @@ print(json.loads("9111222333444555666"))
print(json.loads("-9111222333444555666"))
print(json.loads("9111222333444555666"))
print(json.loads("-9111222333444555666"))
-print(json.loads("[\"9111222333444555666777\",9111222333444555666]"))
+print(json.loads('["9111222333444555666777",9111222333444555666]'))
diff --git a/tests/extmod/tls_dtls.py b/tests/extmod/tls_dtls.py
index a475cce8c..753ab2fee 100644
--- a/tests/extmod/tls_dtls.py
+++ b/tests/extmod/tls_dtls.py
@@ -35,7 +35,7 @@ client_socket = DummySocket()
dtls_server_ctx = SSLContext(PROTOCOL_DTLS_SERVER)
dtls_server_ctx.verify_mode = CERT_NONE
dtls_server = dtls_server_ctx.wrap_socket(
- server_socket, do_handshake_on_connect=False, client_id=b'dummy_client_id'
+ server_socket, do_handshake_on_connect=False, client_id=b"dummy_client_id"
)
print("Wrapped DTLS Server")
diff --git a/tests/float/math_fun_special.py b/tests/float/math_fun_special.py
index a747f73e9..ecacedec5 100644
--- a/tests/float/math_fun_special.py
+++ b/tests/float/math_fun_special.py
@@ -52,6 +52,6 @@ for function_name, function, test_vals in functions:
except ValueError as e:
ans = str(e)
# a tiny error in REPR_C value for 1.5204998778 causes a wrong rounded value
- if is_REPR_C and function_name == 'erfc' and ans == "1.521":
+ if is_REPR_C and function_name == "erfc" and ans == "1.521":
ans = "1.52"
print("{}({:.4g}) = {}".format(function_name, value, ans))
diff --git a/tests/import/import_star.py b/tests/import/import_star.py
index 0947f6a83..2cb21b877 100644
--- a/tests/import/import_star.py
+++ b/tests/import/import_star.py
@@ -7,39 +7,39 @@ try:
except TypeError:
# 2-argument version of next() not supported
# we are probably not at MICROPY_CONFIG_ROM_LEVEL_BASIC_FEATURES
- print('SKIP')
+ print("SKIP")
raise SystemExit
# 1. test default visibility
from pkgstar_default import *
-print('visibleFun' in globals())
-print('VisibleClass' in globals())
-print('_hiddenFun' in globals())
-print('_HiddenClass' in globals())
+print("visibleFun" in globals())
+print("VisibleClass" in globals())
+print("_hiddenFun" in globals())
+print("_HiddenClass" in globals())
print(visibleFun())
# 2. test explicit visibility as defined by __all__ (as an array)
from pkgstar_all_array import *
-print('publicFun' in globals())
-print('PublicClass' in globals())
-print('unlistedFun' in globals())
-print('UnlistedClass' in globals())
-print('_privateFun' in globals())
-print('_PrivateClass' in globals())
+print("publicFun" in globals())
+print("PublicClass" in globals())
+print("unlistedFun" in globals())
+print("UnlistedClass" in globals())
+print("_privateFun" in globals())
+print("_PrivateClass" in globals())
print(publicFun())
# test dynamic import as used in asyncio
-print('dynamicFun' in globals())
+print("dynamicFun" in globals())
print(dynamicFun())
# 3. test explicit visibility as defined by __all__ (as an tuple)
from pkgstar_all_tuple import *
-print('publicFun2' in globals())
-print('PublicClass2' in globals())
-print('unlistedFun2' in globals())
-print('UnlistedClass2' in globals())
+print("publicFun2" in globals())
+print("PublicClass2" in globals())
+print("unlistedFun2" in globals())
+print("UnlistedClass2" in globals())
print(publicFun2())
# 4. test reporting of missing entries in __all__
diff --git a/tests/import/pkgstar_all_array/__init__.py b/tests/import/pkgstar_all_array/__init__.py
index 4499a94d5..03b012123 100644
--- a/tests/import/pkgstar_all_array/__init__.py
+++ b/tests/import/pkgstar_all_array/__init__.py
@@ -1,4 +1,4 @@
-__all__ = ['publicFun', 'PublicClass', 'dynamicFun']
+__all__ = ["publicFun", "PublicClass", "dynamicFun"]
# Definitions below should always be imported by a star import
diff --git a/tests/import/pkgstar_all_miss/__init__.py b/tests/import/pkgstar_all_miss/__init__.py
index d960c7d0e..f9bbb5380 100644
--- a/tests/import/pkgstar_all_miss/__init__.py
+++ b/tests/import/pkgstar_all_miss/__init__.py
@@ -1,4 +1,4 @@
-__all__ = ('existingFun', 'missingFun')
+__all__ = ("existingFun", "missingFun")
def existingFun():
diff --git a/tests/import/pkgstar_all_tuple/__init__.py b/tests/import/pkgstar_all_tuple/__init__.py
index a97715ed3..433ddc8e9 100644
--- a/tests/import/pkgstar_all_tuple/__init__.py
+++ b/tests/import/pkgstar_all_tuple/__init__.py
@@ -1,4 +1,4 @@
-__all__ = ('publicFun2', 'PublicClass2')
+__all__ = ("publicFun2", "PublicClass2")
# Definitions below should always be imported by a star import
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 328d69f63..a428665db 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -16,7 +16,7 @@ import threading
import tempfile
# Maximum time to run a single test, in seconds.
-TEST_TIMEOUT = float(os.environ.get('MICROPY_TEST_TIMEOUT', 30))
+TEST_TIMEOUT = float(os.environ.get("MICROPY_TEST_TIMEOUT", 30))
# See stackoverflow.com/questions/2632199: __file__ nor sys.argv[0]
# are guaranteed to always work, this one should though.
@@ -411,7 +411,7 @@ def run_micropython(pyb, args, test_file, test_file_abspath, is_special=False):
def send_get(what):
# Detect {\x00} pattern and convert to ctrl-key codes.
ctrl_code = lambda m: bytes([int(m.group(1))])
- what = re.sub(rb'{\\x(\d\d)}', ctrl_code, what)
+ what = re.sub(rb"{\\x(\d\d)}", ctrl_code, what)
os.write(master, what)
return get()