Repository navigation
tests: the CI registration scan counts the tests a TestCase inherits from a class of its module (TEST-CI-REG-LOCAL-MIXIN) - #1365
Merged
aslan2142 merged 1 commit intoNov 24, 2026
Conversation
…from a class of its module (TEST-CI-REG-LOCAL-MIXIN) tests/test_ci_registration.py fails on main since 540d511 (the merge of ProjectLeonida#930) and passes on its parent: test_every_selected_file_exposes_a_test_to_its_runner reports tests/semantic/test_sub_co_same_operand.py as a file the semantic job collects nothing from. `python -m unittest discover -s tests/semantic -p test_sub_co_same_operand.py` runs 6 tests there. Its three TestCase classes have no test method of their own: they take them from a mixin class defined in the same file, one TestCase per wave size. defines_a_test looked at a TestCase's own body and at a base imported from another module, not at a base defined in the module. It now also counts the test* methods of the classes of the module a TestCase derives from, directly or through other classes of the module, and an imported base reached that way. unittest's loader lists a class's tests with dir(), so these are the tests it runs. The new test writes eight small modules, runs unittest discover on them once and holds the scan to what the runner collected: a mixin above the TestCase, two classes up, beside a TestCase base without tests, an imported mixin named directly and through a local class (a test each), and a base without tests, a mixin no TestCase derives from and a mixin without a TestCase (none). With main's defines_a_test put back, four of the five cases with a test fail, and so does the repository check. Over the repository at 51a6074: the scan lists the same 997 test files; of the 473 the semantic job selects, main's scan found a test in 472 and this one in 473, and test_sub_co_same_operand.py is the only file the two disagree on (none of the pytest job's 36). unittest's loader collects tests from all 473 (6191 tests, no import failure), so main's scan disagreed with the runner on that one file and this one on none. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 24, 2026
Contributor
Author
|
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
Edited at 23:25 and 23:38 UTC: the first version of this comment named two failing files and left out AI-assisted. |
3 tasks done
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
… with ProjectLeonida#1012 merged Takes the updated head of ProjectLeonida#1034's branch, which holds main 6558d53 (ProjectLeonida#1012, GPU-CMP-F64, is merged there). Git merged it without conflicts (git merge-tree, exit 0), and the tree is the one a direct merge of main gives. GitHub had reported a conflict since ProjectLeonida#1012 merged, with the branch and main on two merge bases (68d1331 and 5040782). Merging ProjectLeonida#1034's head instead of main leaves this branch with one merge base with main when ProjectLeonida#1034 merges. The merged tree was tested before the push: every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main 6558d53 alone (ProjectLeonida#1365 fixes it). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
milk4sale
added a commit
to milk4sale/leonida
that referenced
this pull request
Nov 24, 2026
…ProjectLeonida#1012 merged Takes the updated head of ProjectLeonida#1034's branch, which holds main 6558d53 (ProjectLeonida#1012, GPU-CMP-F64, is merged there). Git merged it without conflicts (git merge-tree, exit 0), and the tree is the one a direct merge of main gives. GitHub had reported a conflict since ProjectLeonida#1012 merged, with the branch and main on two merge bases (68d1331 and 5040782). Merging ProjectLeonida#1034's head instead of main leaves this branch with one merge base with main when ProjectLeonida#1034 merges. The merged tree was tested before the push: every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main 6558d53 alone (ProjectLeonida#1365 fixes it). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
aslan2142
pushed a commit
that referenced
this pull request
Nov 24, 2026
Brings the branch up to date with main 6558d53, which now holds #1012 (GPU-CMP-F64), the pull request this one was stacked on. Git merged it without conflicts (git merge-tree, exit 0). GitHub had reported a conflict since #1012 merged, with the branch and main on two merge bases (68d1331 and 5040782); main is an ancestor of this commit. The merged tree was tested before the push: every standalone test file under tests/ passes except tests/test_ci_registration.py, which fails on main 6558d53 alone (#1365 fixes it). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Collaborator
|
Merged. Thanks: this turns
The case of an inherited AI-assisted (Claude Code, Claude Fable 5.2 and Claude Opus 5.5). |
4 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: TEST-CI-REG-LOCAL-MIXIN (#14 (comment))
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