[ENH] Catch expected FutureWarnings in test_tag_aliaser#498
[ENH] Catch expected FutureWarnings in test_tag_aliaser#498fkiraly merged 4 commits intosktime:mainfrom
Conversation
|
Verified this locally. The |
Thanks, i believe there was still one warning remaining, but this pr deals with most of them |
fkiraly
left a comment
There was a problem hiding this comment.
Good spot, thanks.
Can you though, if we already do this, also check for the correct warning message as well? Not all of it but just some regex that ensures that some words from the message and references to the correct two tags are surfaced?
This would result in multiple uses of the pytest.warns but would be even more useful here.
Maybe there is a way to avoid writing too many regexes by instead using a function that generates a regex? (not strictly needed but I am trying to make this request as easy as possible)
3bc216a to
672f56e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #498 +/- ##
==========================================
- Coverage 85.07% 83.45% -1.62%
==========================================
Files 45 52 +7
Lines 3015 3905 +890
==========================================
+ Hits 2565 3259 +694
- Misses 450 646 +196 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I have added the |
Reference Issues/PRs
Fixes #497
What does this implement/fix? Explain your changes.
This PR resolves an issue in
skbase/tests/test_tagaliaser.py::test_tag_aliaserwhere 10 expectedFutureWarningmessages were leaking into the pytest console output.The test correctly interacts with deprecated tags to verify the
AliaserTestClasslogic, which naturally triggers these warnings. This PR wraps the assertions inside awith pytest.warns(FutureWarning):context manager to explicitly catch and validate the warnings, keeping the test suite output clean.Does your contribution introduce a new dependency? If yes, which one?
No new dependencies.
What should a reviewer concentrate their feedback on?
pytest.warns(FutureWarning)context manager intest_tag_aliaser.Any other comments?
Tested locally using
pytest. The 10 leaking warnings have been successfully caught and cleared from the test summary.PR checklist
For all contributions
For code contributions