Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a compatibility issue with pytest 9.0+ where specifying a subset of tests to run at the command line was not working due to the presence of . (current directory) as an explicit argument in the hatch test scripts.
Changes:
- Removed
.argument fromtest:allandtest:coveragehatch scripts in pyproject.toml, allowing pytest arguments to be properly passed through
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aazuspan
approved these changes
Feb 4, 2026
Contributor
aazuspan
left a comment
There was a problem hiding this comment.
LGTM! I'm a little surprised that it worked before, since it seems like it would have been called with two paths...
This looks like a good fix, since calling pytest with no path runs everything. I tested locally and everything worked as expected in both 8.4.1 and 9.0.2.
Member
Author
|
Thanks, @aazuspan. Merged! |
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.
As of
pytest>9.0, usingpytest . {args}as the hatch script fortest:allno longer allows specification of a subset of tests to run at command line. For example:will run all tests in the test suite and not just the tests in
test_regressions.py. This PR simply removes the current directory (.) as a command-line argument to bothtest:allandtest:coveragescripts which fixes the issue.@aazuspan, in my limited searching, I couldn't find a specific issue/PR in
pytestthat noted this change. I came across it when I updated the packages in my hatchtestenvironment as part of some testing on #99. I think this is an OK fix, but let me know if there is a better way to get around this issue.