mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:05:53 +01:00
[PR #557] [MERGED] run_semantic_tests: a package initializer runs once, and a run with no tests fails #603
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#603
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/557
Author: @ddddddddwp
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:fix/semantic-parallel-initializer📝 Commits (1)
66dac0drun_semantic_tests: a package initializer runs once, and a run with no tests fails📊 Changes
2 files changed (+38 additions, -3 deletions)
View changed files
📝
scripts/run_semantic_tests.py(+12 -3)📝
tests/test_run_semantic_tests.py(+26 -0)📄 Description
Finding: the 2026-11-24 07:17 comment in #14 (Dezmonius), claimed there.
What
Two serial/parallel differences in
scripts/run_semantic_tests.py:A package initializer ran twice in its
-j 2worker.test_modules()listspkg.__init__, andpython -m unittest pkg.__init__importspkgand then executes the same file again aspkg.__init__. Aregistration in the initializer therefore happened twice (
['pkg', 'pkg.__init__']) while-j 1(discover)imports it once.
run_module()now hands unittest the package name (pkg);module_path()still resolves theinitializer's path, so the largest-file-first order is unchanged and the failure still names
pkg.__init__.A run with no tests was green in parallel. With only an empty
pkg/__init__.py,-j 1exits 5 but-j 2printed
1 files, 0 tests, 0 files failedand exited 0. A parallel run where every job ran no tests now printsno tests ran in <dir>and exits 1. An empty initializer beside real tests is still accepted (the existingexit 5/NO TESTS RANmapping), because the run's total is above zero.Tests
tests/test_run_semantic_tests.py, two new cases:test_package_initializer_runs_once_in_parallel: apkg/__init__.pythat appends__name__and asserts the listis
['pkg'], in-j 1and-j 2.test_empty_package_alone_is_not_a_false_green: only an emptypkg/__init__.py, both modes must exit nonzero andthe parallel output names the reason.
Both fail against the previous script (
jobs=2subtest) and pass now:Manual fixture from the finding, with the new script:
-j 2gives1 files, 1 tests, 0 files failed(exit 0), andthe empty package gives
no tests ran in ...(exit 1, where the old script exited 0).macOS arm64, CPython 3.14.10, standard library only. No game files, no GPU, nothing online.
AI-assisted.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.