Files
mandy/scripts
ddddddddwp 66dac0d938 run_semantic_tests: a package initializer runs once, and a run with no tests fails
`python -m unittest pkg.__init__` imports pkg and then executes the same file again as
pkg.__init__, so a registration in the initializer happens twice in the -j 2 worker while
discover imports it once. Hand unittest the package name instead; module_path() still
resolves the initializer, so the largest-file-first order is unchanged.

A suite whose only module is an empty package initializer reported "1 files, 0 tests, 0
files failed" and exit 0 in parallel mode, where -j 1 (discover) exits 5. A run where every
job ran no tests now prints "no tests ran" and exits 1; an empty initializer next to real
tests is still fine because those count.

Both new cases in tests/test_run_semantic_tests.py fail against the previous script.
2026-11-24 16:02:00 +08:00
..