Skip to content

Commit 317f5d7

Browse files
committed
Leave MP tests as-is
1 parent 7e6b055 commit 317f5d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4
-47
lines changed

tests/cpydiff/builtin_next_arg2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99
except StopIteration:
1010
val = deflt
1111
"""
12-
1312
print(next(iter(range(0)), 42))

tests/cpydiff/core_class_delnotimpl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import gc
98

109

tests/cpydiff/core_function_argcount.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython counts "self" as an argument.
55
workaround: Interpret error messages with the information above in mind.
66
"""
7-
87
try:
98
[].append()
109
except Exception as e:

tests/cpydiff/core_import_all.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Not implemented.
55
workaround: Manually import the sub-modules directly in __init__.py using ``from . import foo, bar``.
66
"""
7-
87
from modules3 import *
98

109
foo.hello()

tests/cpydiff/core_import_path.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage.
55
workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications.
66
"""
7-
87
import modules
98

109
print(modules.__path__)

tests/cpydiff/core_import_split_ns_pkgs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython's import system is highly optimized for simplicity, minimal memory usage, and minimal filesystem search overhead.
55
workaround: Don't install modules belonging to the same namespace package in different directories. For MicroPython, it's recommended to have at most 3-component module search paths: for your current application, per-user (writable), system-wide (non-writable).
66
"""
7-
87
import sys
98

109
sys.path.append(sys.path[1] + "/modules")

tests/cpydiff/core_locals_eval.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython doesn't maintain symbolic local environment, it is optimized to an array of slots. Thus, local variables can't be accessed by a name. Effectively, ``eval(expr)`` in MicroPython is equivalent to ``eval(expr, globals(), globals())``.
55
workaround: Unknown
66
"""
7-
87
val = 1
98

109

tests/cpydiff/module_array_comparison.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Code size
55
workaround: Compare individual elements
66
"""
7-
87
import array
98

109
array.array("b", [1, 2]) == array.array("i", [1, 2])

tests/cpydiff/module_array_constructor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython implements implicit truncation in order to reduce code size and execution time
55
workaround: If CPython compatibility is needed then mask the value explicitly
66
"""
7-
87
import array
98

109
a = array.array("b", [257])

tests/cpydiff/modules_array_containment.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import array
98

109
print(1 in array.array("B", b"12"))

tests/cpydiff/modules_array_deletion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import array
98

109
a = array.array("b", (1, 2, 3))

tests/cpydiff/modules_array_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import array
98

109
a = array.array("b", (1, 2, 3))

tests/cpydiff/modules_deque.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Use regular lists. micropython-lib has implementation of collections.deque.
66
"""
7-
87
import collections
98

109
D = collections.deque()

tests/cpydiff/modules_json_nonserializable.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import json
98

109
a = bytes(x for x in range(256))

tests/cpydiff/modules_os_environ.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Use ``getenv``, ``putenv`` and ``unsetenv``
66
"""
7-
87
import os
98

109
try:

tests/cpydiff/modules_os_getenv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: The ``environ`` attribute is not implemented
55
workaround: Unknown
66
"""
7-
87
import os
98

109
print(os.getenv("NEW_VARIABLE"))

tests/cpydiff/modules_struct_fewargs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import struct
98

109
try:

tests/cpydiff/modules_struct_manyargs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
import struct
98

109
try:

tests/cpydiff/modules_struct_whitespace_in_format.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython is optimised for code size.
55
workaround: Don't use spaces in format strings.
66
"""
7-
87
import struct
98

109
try:

tests/cpydiff/modules_sys_stdassign.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: They are stored in read-only memory.
55
workaround: Unknown
66
"""
7-
87
import sys
98

109
sys.stdin = None

tests/cpydiff/syntax_assign_expr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: MicroPython is optimised for code size and doesn't check this case.
55
workaround: Do not rely on this behaviour if writing CPython compatible code.
66
"""
7-
87
print([i := -1 for i in range(4)])

tests/cpydiff/syntax_spaces.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
try:
98
print(eval("1and 0"))
109
except SyntaxError:

tests/cpydiff/syntax_unicode_nameesc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("\N{LATIN SMALL LETTER A}")

tests/cpydiff/types_bytearray_sliceassign.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
b = bytearray(4)
98
b[0:1] = [1, 2]
109
print(b)

tests/cpydiff/types_bytes_format.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: MicroPython strives to be a more regular implementation, so if both `str` and `bytes` support ``__mod__()`` (the % operator), it makes sense to support ``format()`` for both too. Support for ``__mod__`` can also be compiled out, which leaves only ``format()`` for bytes formatting.
55
workaround: If you are interested in CPython compatibility, don't use ``.format()`` on bytes objects.
66
"""
7-
87
print(b"{}".format(1))

tests/cpydiff/types_bytes_keywords.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Pass the encoding as a positional parameter, e.g. ``print(bytes('abc', 'utf-8'))``
66
"""
7-
87
print(bytes("abc", encoding="utf8"))

tests/cpydiff/types_bytes_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: MicroPython is highly optimized for memory usage.
55
workaround: Use explicit loop for this very rare operation.
66
"""
7-
87
print(b"123"[0:3:2])

tests/cpydiff/types_dict_keys_set.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Not implemented.
55
workaround: Explicitly convert keys to a set before using set operations.
66
"""
7-
87
print({1: 2, 3: 4}.keys() & {1})

tests/cpydiff/types_exception_attrs.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython is optimised to reduce code size.
55
workaround: Only use ``value`` on ``StopIteration`` exceptions, and ``errno`` on ``OSError`` exceptions. Do not use or rely on these attributes on other exceptions.
66
"""
7-
87
e = Exception(1)
98
print(e.value)
109
print(e.errno)

tests/cpydiff/types_exception_chaining.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
try:
98
raise TypeError
109
except TypeError:

tests/cpydiff/types_exception_instancevar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: MicroPython is highly optimized for memory usage.
55
workaround: Use user-defined exception subclasses.
66
"""
7-
87
e = Exception()
98
e.x = 0
109
print(e.x)

tests/cpydiff/types_exception_loops.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Condition checks are optimized to happen at the end of loop body, and that line number is reported.
55
workaround: Unknown
66
"""
7-
87
l = ["-foo", "-bar"]
98

109
i = 0

tests/cpydiff/types_float_rounding.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("%.1g" % -9.9)

tests/cpydiff/types_list_delete_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Use explicit loop for this rare operation.
66
"""
7-
87
l = [1, 2, 3, 4]
98
del l[0:4:2]
109
print(l)

tests/cpydiff/types_list_store_noniter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: RHS is restricted to be a tuple or list
55
workaround: Use ``list(<iter>)`` on RHS to convert the iterable to a list
66
"""
7-
87
l = [10, 20]
98
l[0:1] = range(4)
109
print(l)

tests/cpydiff/types_list_store_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
cause: Unknown
55
workaround: Use explicit loop for this rare operation.
66
"""
7-
87
l = [1, 2, 3, 4]
98
l[0:4:2] = [5, 6]
109
print(l)

tests/cpydiff/types_str_endswith.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("abc".endswith("c", 1))

tests/cpydiff/types_str_formatsubscr.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("{a[0]}".format(a=[1, 2]))

tests/cpydiff/types_str_keywords.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Input the encoding format directly. eg ``print(bytes('abc', 'utf-8'))``
66
"""
7-
87
print(str(b"abc", encoding="utf8"))

tests/cpydiff/types_str_ljust_rjust.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: MicroPython is highly optimized for memory usage. Easy workarounds available.
55
workaround: Instead of ``s.ljust(10)`` use ``"%-10s" % s``, instead of ``s.rjust(10)`` use ``"% 10s" % s``. Alternatively, ``"{:<10}".format(s)`` or ``"{:>10}".format(s)``.
66
"""
7-
87
print("abc".ljust(10))

tests/cpydiff/types_str_rsplitnone.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("a a a".rsplit(None, 1))

tests/cpydiff/types_str_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print("abcdefghi"[0:9:2])

tests/cpydiff/types_tuple_subscrstep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
cause: Unknown
55
workaround: Unknown
66
"""
7-
87
print((1, 2, 3, 4)[0:4:2])

tests/misc/rge_sm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,6 @@ def singleTraj(system, trajStart, h=0.02, tend=1.0):
136136
# phaseDiagram(sysSM, (lambda i, j: [0.354, 0.654, 1.278, 0.8 + 0.2 * i, 0.1 + 0.1 * j]), (lambda a: (a[4], a[5])), h=0.1, tend=math.log(10**17))
137137

138138
# initial conditions at M_Z
139-
singleTraj(sysSM, [0.354, 0.654, 1.278, 0.983, 0.131], h=0.5, tend=math.log(10**17)) # true values
139+
singleTraj(
140+
sysSM, [0.354, 0.654, 1.278, 0.983, 0.131], h=0.5, tend=math.log(10**17)
141+
) # true values

tools/codeformat.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"ports/**/*.py",
5656
"py/**/*.py",
5757
"tools/**/*.py",
58-
"tests/**/*.py",
58+
"tests/circuitpython-*/**/*.py",
5959
]
6060

6161
EXCLUSIONS = [
@@ -65,8 +65,6 @@
6565
"ports/unix/*.py",
6666
# not real python files
6767
"tests/**/repl_*.py",
68-
# needs careful attention before applying automatic formatting
69-
"tests/basics/*.py",
7068
# don't reindent this third-party code we vendored in
7169
"ports/raspberrypi/lwip_src",
7270
]

0 commit comments

Comments
 (0)