Add support for the different pytest files#418
Merged
nathanjmcdougall merged 3 commits intomainfrom Mar 28, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for handling different pytest configuration files by updating test cases and file resolution logic in the tool. Key changes include:
- Updating tests to use a unified files_manager() instead of PyprojectTOMLManager() where appropriate.
- Enhancing configuration file resolution in the core tool with a new "bespoke" resolution mode and expanded file manager options.
- Introducing DotPytestINIManager and PytestINIManager classes to manage .pytest.ini and pytest.ini files respectively.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/usethis/_core/test_core_tool.py | Updated tests to use files_manager() and added new test cases for pytest configuration file priority. |
| src/usethis/_tool.py | Modified configuration resolution logic, added new file managers (including SetupCFGManager reference), and redefined get_active_config_file_managers for bespoke resolution. |
| src/usethis/_config_file.py | Added classes DotPytestINIManager and PytestINIManager to support new pytest configuration files. |
Comments suppressed due to low confidence (1)
src/usethis/_tool.py:940
- There appears to be a duplicate definition of get_active_config_file_managers in the class. Consolidate the function implementations into a single, clear definition to avoid confusion and potential runtime issues.
def get_active_config_file_managers(self) -> set[KeyValueFileManager]:
Co-authored-by: Copilot <[email protected]>
CodSpeed Performance ReportMerging #418 will not alter performanceComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #418 +/- ##
==========================================
- Coverage 98.07% 97.94% -0.13%
==========================================
Files 73 73
Lines 3420 3458 +38
==========================================
+ Hits 3354 3387 +33
- Misses 66 71 +5 ☔ View full report in Codecov by Sentry. |
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.
No description provided.