Skip to content
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

TST: fix compatibility with pytest 8 #820

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

neutrinoceros
Copy link
Contributor

This should resolve the current CI instability. (example logs)

For context, what I think is happening is that the pytest.warns context manager's behavior was changed in pytest 8.0. In older versions, all warnings other than the one we were checking for were silently swallowed, and now they're not. In this specific test, astropy would also emit some AstropyUserWarning(s), which we don't control but are pointing to the very same problem we're testing for, so we should just filter them explicitly.

@neutrinoceros
Copy link
Contributor Author

there was another warning specificly in oldest deps, which took a bit longer to inspect. I think I fixed it but I'll undraft only when CI is actually green everywhere

@neutrinoceros
Copy link
Contributor Author

For context, I tracked the numpy deprecation warning down to astroscrappy. This was fixed upstream in astropy/astroscrappy@e5c12fa (first published in v1.1.0)

I also threw in the --color=yes pytest flag while I was at it, as done in astropy, which helps reading logs in CI

@neutrinoceros
Copy link
Contributor Author

btw Python 3.11 and 3.12 are not tested at all. I'll add them to the test matrix in a follow up PR just in case it uncovers incompatibilities and I need to fix those too.

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.55%. Comparing base (649330c) to head (b962f56).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #820   +/-   ##
=======================================
  Coverage   97.55%   97.55%           
=======================================
  Files           9        9           
  Lines        1392     1392           
=======================================
  Hits         1358     1358           
  Misses         34       34           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mwcraig
Copy link
Member

mwcraig commented Apr 9, 2024

Thanks, @neutrinoceros!

@mwcraig mwcraig merged commit 42f7e40 into astropy:main Apr 9, 2024
12 of 13 checks passed
@neutrinoceros neutrinoceros deleted the pytest8_compat branch April 9, 2024 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants