tests: the CI registration scan counts the tests a TestCase inherits from a class of its module (TEST-CI-REG-LOCAL-MIXIN) #1365
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!1365
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1365/head"
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?
@milk4sale on GitHub · 2026-11-24 22:37 UTC · original
milk4sale:test/ci-registration-local-mixin→main· +59 −3 · 1 files · 1 commits · merged 2026-11-24 23:26 UTCClaimed in the coordination issue as: TEST-CI-REG-LOCAL-MIXIN (#14)
What and why
mainis red ontests/test_ci_registration.pysince540d5111f, the merge of #930 at 22:12 UTC on 24 November; the test passes on that commit's parent,4a50cafc7. The standard-library loop runs this file, socheck,stdlib-tests-linuxandmacos-pythonfail on every pull request whose run starts on amainfrom then on.test_every_selected_file_exposes_a_test_to_its_runnerreports #930'stests/semantic/test_sub_co_same_operand.pyas a file the semantic job collects nothing from. That is not so:python -m unittest discover -s tests/semantic -p test_sub_co_same_operand.pyruns 6 tests there. Its threeTestCaseclasses have no test method of their own. They take them from_SameOperandMixin, a plain class defined in the same file, oneTestCaseper wave size.defines_a_testlooked at aTestCase's own body and at a base imported from another module, and not at a base defined in the module, so the fault is in the scan and #930's file stays as it is.The scan now also counts:
test*methods of the classes of the module that aTestCasederives from, directly or through other classes of the module;class Middle(Imported), thenclass Example(Middle, unittest.TestCase)), as it already did for one theTestCasenames itself.unittest's loader lists a class's tests withdir(), so these are tests the runner runs.Tested
python -I tests/test_ci_registration.py: 16 tests pass on this branch (main89d7dfcf5plus the commit). Onmainalone it fails attest_every_selected_file_exposes_a_test_to_its_runner; at4a50cafc7it passes and at540d5111fit fails.test_inherited_tests_count_where_unittest_discover_collects_them, does not carry my expectations alone: it writes eight small modules, runsunittest discoveron them once and holds the scan to what the runner collected. Five have a test (a mixin above theTestCase, two classes up, beside aTestCasebase without tests, an imported mixin named directly and through a local class) and three have none (a base without tests, a mixin noTestCasederives from, a mixin without aTestCase).main'sdefines_a_testput back, that test fails in four of the five cases with a test (all but the directly named imported mixin, whichmainalready handled), and the repository check fails as onmain.51a6074d2: both scans list the same 997 test files. Of the 473 files the semantic job selects,main's scan finds a test in 472 and this one in 473;test_sub_co_same_operand.pyis the only file the two disagree on, and they agree on all 36 files of the pytest job.unittest's loader collects tests from all 473 semantic files (6191 tests, no import failure). Somain's scan disagreed with the runner on that one file, and this one disagrees on none.tests/withpython -I(491 files): all pass, wheremainhas the one failure.python -I scripts/check_no_game_data.py tests/test_ci_registration.py,python -m compileallandgit diff --check.Run with Python 3.14.10 on Linux. Not run locally: Python 3.12 (the version CI installs), Windows and macOS. The new test reads
unittest's verbose output the waytest_semantic_selection_matches_discovery_through_packagesin the same file already does.GPUs tested: n/a (one Python test file; no shader, fixture or runtime code)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (No translator change.)🤖 Generated with Claude Code
@milk4sale on GitHub · 2026-11-24 23:01 UTC · original · edited 2026-11-24 23:38 UTC
CI for this commit on my fork, since the queue here is hours behind: https://github.com/milk4sale/leonida/actions/runs/45502632816 (a manual run of the
CIworkflow on the branch as it is,fd0a53907onmain89d7dfcf5; Python 3.12).stdlib-tests-linux: success. It fails onmain.tests/test_ci_registration.pyitself: 16 tests OK on Windows (incheck) and on macOS (inmacos-python), read from the two job logs. That covers what I had not run locally (Python 3.12, Windows, macOS).semantic-tests (ubuntu-latest)andviewer-tests: success.translator-tests: failure, 2 failed and 1879 passed. They are the twocs_dpp_cmp.asmtests that are red onmainsince #957; #1375 fixes them.checkandmacos-pythondid not finish: both were cancelled at their time limits (15 and 20 minutes), ascheckwas in the five hourly runs ofmainon the fork before this one. When it was cancelled,checkhad started 379 of 491 files, and three had failed:tests/test_bink_names.pyandtests/test_opus_tags.py(a repr'd Windows path in an error message, which #128 is about) andtests/test_run_wine_tests.py(aKeyErrorintest_jobs_keeps_locks_serial_tests_and_dependencies, which #1354 added; the same file passes on Windows in the next two runs and fails again in a fourth, #1410 has the cause). None is touched here.Edited at 23:25 and 23:38 UTC: the first version of this comment named two failing files and left out
tests/test_run_wine_tests.py; the second called its error anIndexErrorand miscounted the later runs.AI-assisted.
@aslan2142 on GitHub · 2026-11-24 23:26 UTC · original
Merged. Thanks: this turns
tests/test_ci_registration.pygreen onmainagain.tests/semantic/test_sub_co_same_operand.py, whoseTestCaseclasses inherit their tests from a mixin in the same file, and the scan counted that file as having no test. I merged #930 without running this file, so that one is on me; it madecheck,stdlib-tests-linuxandmacos-pythonfail on every pull request since.TEST-CI-REG-LOCAL-MIXINwas posted at 22:30 UTC, before this PR, and is unedited.test*methods. Over everytests/**/test_*.py, onlytests/semantic/test_sub_co_same_operand.pychanges its result, from no test to having one. The change can only add tests to a file's count, so no file is newly flagged.tests/test_ci_registration.py: onmain15 tests with 1 failure; with this PR 16 tests, all passing. The new test fails 4 of its cases againstmain's version of the scan.maincdb003ea1+fd0a53907: the semantic suite passes (475 files, 6,220 tests, 0 files failed); the 13 docs and writer tests pass;check_no_game_data.pyis clean on the 1 changed files.The case of an inherited
@property test_*is left to the follow-up #1385.AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5).