From 4d905ef55235ed6f2f2d02799a3089ae8eb0c6e3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 16 Sep 2025 12:55:59 +1000 Subject: [PATCH] tests/run-tests.py: Skip certain tests when using --via-mpy. These tests cannot pass when using `--via-mpy`. Signed-off-by: Damien George --- tests/run-tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/run-tests.py b/tests/run-tests.py index d6eb9a3fbc..1aec3ad85e 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -107,6 +107,19 @@ PC_PLATFORMS = ("darwin", "linux", "win32") platform_to_port_map = {"pyboard": "stm32", "WiPy": "cc3200"} platform_to_port_map.update({p: "unix" for p in PC_PLATFORMS}) +# Tests to skip for values of the `--via-mpy` argument. +via_mpy_tests_to_skip = { + # Skip the following when mpy is enabled. + True: ( + # These print out the filename and that's expected to match the .py name. + "import/import_file.py", + "io/argv.py", + "misc/sys_settrace_features.py", + "misc/sys_settrace_generator.py", + "misc/sys_settrace_loop.py", + ), +} + # Tests to skip for specific emitters. emitter_tests_to_skip = { # Some tests are known to fail with native emitter. @@ -925,6 +938,9 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): skip_tests.add("unicode/file2.py") # requires local file access skip_tests.add("unicode/file_invalid.py") # requires local file access + # Skip certain tests when going via a .mpy file. + skip_tests.update(via_mpy_tests_to_skip.get(args.via_mpy, ())) + # Skip emitter-specific tests. skip_tests.update(emitter_tests_to_skip.get(args.emit, ()))