mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 22:08:40 +00:00
`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.