Skip to content

Commit 2fd4bce

Browse files
committed
Switch to a micropython test
1 parent b7a29b5 commit 2fd4bce

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

ports/zephyr-cp/tests/conftest.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,22 +289,12 @@ def circuitpython(request, board, sim_id, native_sim_binary, native_sim_env, tmp
289289
tmp_drive = tmp_path / f"drive{i}"
290290
tmp_drive.mkdir(exist_ok=True)
291291

292-
created_dirs: set[str] = set()
293292
for name, content in files.items():
294293
src = tmp_drive / name
295-
src.parent.mkdir(parents=True, exist_ok=True)
296294
if isinstance(content, bytes):
297295
src.write_bytes(content)
298296
else:
299297
src.write_text(content)
300-
parent = Path(name).parent
301-
if parent != Path("."):
302-
parts = parent.parts
303-
for depth in range(1, len(parts) + 1):
304-
sub = "/".join(parts[:depth])
305-
if sub not in created_dirs:
306-
subprocess.run(["mmd", "-i", str(flash), f"::{sub}"], check=True)
307-
created_dirs.add(sub)
308298
subprocess.run(["mcopy", "-i", str(flash), str(src), f"::{name}"], check=True)
309299

310300
trace_file = tmp_path / f"trace-{i}.perfetto"

ports/zephyr-cp/tests/test_basics.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,28 +92,6 @@ def test_ctrl_c_interrupt(circuitpython):
9292
assert "completed" not in output
9393

9494

95-
IMPORT_PRECEDENCE_CODE = """\
96-
import fake_lib
97-
print("done")
98-
"""
99-
100-
101-
@pytest.mark.circuitpy_drive(
102-
{
103-
"code.py": IMPORT_PRECEDENCE_CODE,
104-
"fake_lib/a_spritesheet.bmp": b"",
105-
"fake_lib.py": 'print("hello fake_lib.py")\n',
106-
}
107-
)
108-
def test_py_file_wins_over_namespace_dir(circuitpython):
109-
"""#10614: a .py module beats a sibling directory lacking __init__.py."""
110-
circuitpython.wait_until_done()
111-
112-
output = circuitpython.serial.all_output
113-
assert "hello fake_lib.py" in output
114-
assert "done" in output
115-
116-
11795
RELOAD_CODE = """\
11896
print("first run")
11997
import time

tests/import/import_shared_name.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://github.com/adafruit/circuitpython/issues/10614
2+
# When a directory `shared_name/` (no __init__.py) and a module `shared_name.py`
3+
# share a name, `import shared_name` must pick the .py module per PEP 420
4+
# precedence: regular package > module > namespace package.
5+
import shared_name
6+
7+
print("done")

tests/import/shared_name.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("hello shared_name.py")

tests/import/shared_name/spritesheet.bmp

Whitespace-only changes.

0 commit comments

Comments
 (0)