Skip to content

Commit 4216bc7

Browse files
committed
tests: Replace umodule with module everywhere.
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 5e50975 commit 4216bc7

295 files changed

Lines changed: 1009 additions & 1431 deletions

File tree

Some content is hidden

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

ports/unix/coverage.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,19 +356,19 @@ STATIC mp_obj_t extra_coverage(void) {
356356
mp_printf(&mp_plat_print, "# repl\n");
357357

358358
const char *str;
359-
size_t len = mp_repl_autocomplete("__n", 3, &mp_plat_print, &str);
359+
size_t len = mp_repl_autocomplete("__n", 3, &mp_plat_print, &str); // expect "ame__"
360360
mp_printf(&mp_plat_print, "%.*s\n", (int)len, str);
361361

362-
len = mp_repl_autocomplete("i", 1, &mp_plat_print, &str);
362+
len = mp_repl_autocomplete("im", 2, &mp_plat_print, &str); // expect "port"
363363
mp_printf(&mp_plat_print, "%.*s\n", (int)len, str);
364-
mp_repl_autocomplete("import ", 7, &mp_plat_print, &str);
365-
len = mp_repl_autocomplete("import ut", 9, &mp_plat_print, &str);
364+
mp_repl_autocomplete("import ", 7, &mp_plat_print, &str); // expect the list of builtins
365+
len = mp_repl_autocomplete("import ti", 9, &mp_plat_print, &str); // expect "me"
366366
mp_printf(&mp_plat_print, "%.*s\n", (int)len, str);
367-
mp_repl_autocomplete("import time", 12, &mp_plat_print, &str);
367+
mp_repl_autocomplete("import time", 11, &mp_plat_print, &str); // expect "time timeq"
368368

369369
mp_store_global(MP_QSTR_sys, mp_import_name(MP_QSTR_sys, mp_const_none, MP_OBJ_NEW_SMALL_INT(0)));
370-
mp_repl_autocomplete("sys.", 4, &mp_plat_print, &str);
371-
len = mp_repl_autocomplete("sys.impl", 8, &mp_plat_print, &str);
370+
mp_repl_autocomplete("sys.", 4, &mp_plat_print, &str); // expect dir(sys)
371+
len = mp_repl_autocomplete("sys.impl", 8, &mp_plat_print, &str); // expect "ementation"
372372
mp_printf(&mp_plat_print, "%.*s\n", (int)len, str);
373373
}
374374

tests/basics/array1.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
try:
2-
import uarray as array
2+
import array
33
except ImportError:
4-
try:
5-
import array
6-
except ImportError:
7-
print("SKIP")
8-
raise SystemExit
4+
print("SKIP")
5+
raise SystemExit
96

107
a = array.array('B', [1, 2, 3])
118
print(a, len(a))

tests/basics/array_add.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# test array + array
22
try:
3-
import uarray as array
3+
import array
44
except ImportError:
5-
try:
6-
import array
7-
except ImportError:
8-
print("SKIP")
9-
raise SystemExit
5+
print("SKIP")
6+
raise SystemExit
107

118
a1 = array.array('I', [1])
129
a2 = array.array('I', [2])

tests/basics/array_construct.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# test construction of array.array from different objects
22

33
try:
4-
from uarray import array
4+
from array import array
55
except ImportError:
6-
try:
7-
from array import array
8-
except ImportError:
9-
print("SKIP")
10-
raise SystemExit
6+
print("SKIP")
7+
raise SystemExit
118

129
# tuple, list
1310
print(array('b', (1, 2)))

tests/basics/array_construct2.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
try:
2-
from uarray import array
2+
from array import array
33
except ImportError:
4-
try:
5-
from array import array
6-
except ImportError:
7-
print("SKIP")
8-
raise SystemExit
4+
print("SKIP")
5+
raise SystemExit
96

107
# construct from something with unknown length (requires generators)
118
print(array('i', (i for i in range(10))))
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# test construction of array.array from different objects
22

33
try:
4-
from uarray import array
4+
from array import array
55
except ImportError:
6-
try:
7-
from array import array
8-
except ImportError:
9-
print("SKIP")
10-
raise SystemExit
6+
print("SKIP")
7+
raise SystemExit
118

129
# raw copy from bytes, bytearray
1310
print(array('h', b'12'))

tests/basics/array_intbig.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# test array types QqLl that require big-ints
22

33
try:
4-
from uarray import array
4+
from array import array
55
except ImportError:
6-
try:
7-
from array import array
8-
except ImportError:
9-
print("SKIP")
10-
raise SystemExit
6+
print("SKIP")
7+
raise SystemExit
118

129
print(array('L', [0, 2**32-1]))
1310
print(array('l', [-2**31, 0, 2**31-1]))

tests/basics/array_micropython.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
# test MicroPython-specific features of array.array
22
try:
3-
import uarray as array
3+
import array
44
except ImportError:
5-
try:
6-
import array
7-
except ImportError:
8-
print("SKIP")
9-
raise SystemExit
5+
print("SKIP")
6+
raise SystemExit
107

118
# arrays of objects
129
a = array.array('O')

tests/basics/async_await2.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# test await expression
22

3-
try:
4-
import usys as sys
5-
except ImportError:
6-
import sys
3+
import sys
74
if sys.implementation.name == 'micropython':
85
# uPy allows normal generators to be awaitables
96
coroutine = lambda f: f

tests/basics/async_for2.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# test waiting within "async for" __anext__ function
22

3-
try:
4-
import usys as sys
5-
except ImportError:
6-
import sys
3+
import sys
74
if sys.implementation.name == 'micropython':
85
# uPy allows normal generators to be awaitables
96
coroutine = lambda f: f

0 commit comments

Comments
 (0)