Skip to content

[ENH] Catch expected FutureWarnings in test_tag_aliaser#498

Merged
fkiraly merged 4 commits intosktime:mainfrom
Dreamstick9:fix-tag-warnings
Mar 1, 2026
Merged

[ENH] Catch expected FutureWarnings in test_tag_aliaser#498
fkiraly merged 4 commits intosktime:mainfrom
Dreamstick9:fix-tag-warnings

Conversation

@Dreamstick9
Copy link
Contributor

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_aliaser where 10 expected FutureWarning messages were leaking into the pytest console output.

The test correctly interacts with deprecated tags to verify the AliaserTestClass logic, which naturally triggers these warnings. This PR wraps the assertions inside a with 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?

  • The implementation of the pytest.warns(FutureWarning) context manager in test_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
  • I've reviewed the project documentation on contributing
  • I've added myself to the list of contributors.
  • The PR title starts with either [ENH], [CI/CD], [MNT], [DOC], or [BUG] indicating whether the PR topic is related to enhancement, CI/CD, maintenance, documentation, or a bug.
For code contributions
  • Unit tests have been added covering code functionality
  • Appropriate docstrings have been added
  • New public functionality has been added to the API Reference

@alphaleporus
Copy link

Verified this locally. The FutureWarnings were indeed cluttering the output during pytest skbase/tests/test_tagaliaser.py, and this PR successfully captures them. Great maintenance fix.

@Dreamstick9
Copy link
Contributor Author

Verified this locally. The FutureWarnings were indeed cluttering the output during pytest skbase/tests/test_tagaliaser.py, and this PR successfully captures them. Great maintenance fix.

Thanks, i believe there was still one warning remaining, but this pr deals with most of them

Copy link
Contributor

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@codecov
Copy link

codecov bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.45%. Comparing base (306958d) to head (6060cc3).
⚠️ Report is 183 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dreamstick9 Dreamstick9 requested a review from fkiraly February 26, 2026 10:03
@Dreamstick9
Copy link
Contributor Author

I have added the _tag_deprecation_regex function and ran pytest locally(all the tests passed)

Copy link
Contributor

@fkiraly fkiraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fkiraly fkiraly merged commit 5ecc8c9 into sktime:main Mar 1, 2026
23 checks passed
@fkiraly fkiraly added the enhancement Adding new functionality label Mar 1, 2026
@fkiraly fkiraly changed the title [MNT] Catch expected FutureWarnings in test_tag_aliaser [ENH] Catch expected FutureWarnings in test_tag_aliaser Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adding new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Uncaught FutureWarnings leaking in test_tag_aliaser

3 participants