Allow pytest tests to be named test_#768
Closed
gabrielrussoc wants to merge 2 commits intoaspect-build:mainfrom
Closed
Allow pytest tests to be named test_#768gabrielrussoc wants to merge 2 commits intoaspect-build:mainfrom
gabrielrussoc wants to merge 2 commits intoaspect-build:mainfrom
Conversation
|
gregmagolan
reviewed
Feb 23, 2026
| fail("When pytest_main is set, the main attribute should not be set.") | ||
| pytest_main_target = name + ".pytest_main" | ||
| # Add a prefix to the test main to ensure targets called "test_*" do not get discovered by pytest. | ||
| pytest_main_target = "zzz_" + name + ".pytest_main" |
Member
There was a problem hiding this comment.
Sneaky with the zzz_. The zzz_ will show in the list of targets on query which might throw folks off. Would a prefix of just _ suffice?
arrdem
added a commit
that referenced
this pull request
Mar 19, 2026
- test_multi_src: multiple test sources with test_* target name, the exact #723 reproduction scenario - test_collection_check: asserts pytest collects only expected tests and no spurious generated files sneak into collection - test_direct_pytest_main: cross-repo py_pytest_main() with test_* name, validating the dunder-wrap fix works outside the main repo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.



Fixes #723
Changes are visible to end-users: no
Test plan