-
-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use pytest fixtures to reduce repetition in tests #4509
refactor: use pytest fixtures to reduce repetition in tests #4509
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4509 +/- ##
========================================
Coverage 99.42% 99.42%
========================================
Files 299 299
Lines 22691 22691
========================================
Hits 22560 22560
Misses 131 131 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making a start, @Aswinr24! I've added a few suggestions below; please let me know what you think?
Thanks for your suggestions, @agriyakhetarpal ! I've made the changes based on your feedback. Let me know if anything else needs tweaking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Aswinr24! FYI, I changed the "Fixes" keyword in the PR description to "Related to" since #4502 should include more such files, and we'd like this PR not to close that issue. If you're interested in contributing further, could you open more PRs after this for other cases where we can parametrize tests?
@all-contributors please add @Aswinr24 for tests |
I've put up a pull request to add @Aswinr24! 🎉 |
…eam#4509) * refactor: use pytest fixtures to reduce repetition in tests * style: pre-commit fixes * refactor: use pytest fixtures to reduce repetition in tests(v2) * refactor: use pytest fixtures to reduce repetition in tests(v2) * refactor: use pytest fixtures to reduce repetition in tests(v2) * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
Refactored the parameter processing test cases to use
pytest
fixtures andpytest.mark.parametrize
to reduce code duplication and improve test maintainability.Related to #4502
Type of change
Key checklist:
$ pre-commit run
(or$ nox -s pre-commit
) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ python run-tests.py --all
(or$ nox -s tests
)$ python run-tests.py --doctest
(or$ nox -s doctests
)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick
(or$ nox -s quick
).Further checks: