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

[MAINT] Pytest fixture to ignore internal deprecation warnings #4043

Merged
merged 5 commits into from Oct 17, 2023

Conversation

ymzayek
Copy link
Member

@ymzayek ymzayek commented Oct 10, 2023

Changes proposed in this pull request:

  • Add a fixture to suppress known internal deprecation warnings

I'm not sure if this is the best approach, but it avoids having to go through all the tests that raise the warning and adding e.g. a parameter to suppress the warning, which is a bit of a hassle and adds parameters unrelated to the particular unit tests. Since the warnings are known and tested it shouldn't have any negative side effects and could also be a way to track our deprecation in one place.

@github-actions
Copy link
Contributor

👋 @ymzayek Thanks for creating a PR!

Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft.

Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.

  • PR has an interpretable title.
  • PR links to Github issue with mention Closes #XXXX (see our documentation on PR structure)
  • Code is PEP8-compliant (see our documentation on coding style)
  • Changelog or what's new entry in doc/changes/latest.rst (see our documentation on PR structure)

For new features:

  • There is at least one unit test per new function / class (see our documentation on testing)
  • The new feature is demoed in at least one relevant example.

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

We will review it as quick as possible, feel free to ping us with questions if needed.

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Merging #4043 (2ae9169) into main (1f20b65) will increase coverage by 22.44%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##             main    #4043       +/-   ##
===========================================
+ Coverage   69.06%   91.50%   +22.44%     
===========================================
  Files         143      143               
  Lines       16011    16072       +61     
  Branches     3057     3339      +282     
===========================================
+ Hits        11058    14707     +3649     
+ Misses       4534      820     -3714     
- Partials      419      545      +126     
Flag Coverage Δ
macos-latest_3.10 91.49% <100.00%> (?)
macos-latest_3.11 91.49% <100.00%> (?)
macos-latest_3.12 91.49% <100.00%> (?)
macos-latest_3.8 91.45% <100.00%> (?)
macos-latest_3.9 91.46% <100.00%> (?)
ubuntu-latest_3.10 91.49% <100.00%> (?)
ubuntu-latest_3.11 91.49% <100.00%> (?)
ubuntu-latest_3.12 91.49% <100.00%> (?)
ubuntu-latest_3.8 91.45% <100.00%> (?)
ubuntu-latest_3.9 91.46% <100.00%> (?)
windows-latest_3.10 91.43% <100.00%> (?)
windows-latest_3.11 91.43% <100.00%> (?)
windows-latest_3.12 91.43% <100.00%> (?)
windows-latest_3.8 91.39% <100.00%> (?)
windows-latest_3.9 91.40% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
nilearn/datasets/atlas.py 93.18% <100.00%> (ø)
nilearn/datasets/func.py 78.40% <100.00%> (-0.21%) ⬇️
nilearn/datasets/struct.py 90.85% <100.00%> (ø)

... and 55 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ymzayek ymzayek marked this pull request as draft October 11, 2023 11:50
@Remi-Gau
Copy link
Collaborator

I would say that until we find a way to uniformize how we throw / test deprecation warnings (see #3673 and #3625) this seems like a good approach for now.

@Remi-Gau
Copy link
Collaborator

failures are unrelated, no?

@bthirion
Copy link
Member

I think they are.

@Remi-Gau
Copy link
Collaborator

Yup. I relaunched the test on main and everything passed so seems unrelated to some dependency change at least.

@Remi-Gau Remi-Gau marked this pull request as ready for review October 16, 2023 10:23
Copy link
Member

@bthirion bthirion left a comment

Choose a reason for hiding this comment

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

LGTM, thx !

@Remi-Gau Remi-Gau merged commit 05ae8ce into nilearn:main Oct 17, 2023
31 checks passed
@ymzayek ymzayek deleted the internal_deprecations branch October 23, 2023 09:03
Comment on lines +120 to +122
"The `darkness` parameter will be deprecated.*|"
"`legacy_format` will default to `False`.*|"
"In release 0.13, this fetcher will return a dictionary.*|"
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for finishing the PR @Remi-Gau !
Just fyi I did not check that this was a thorough list of internal deprecation messages.

Copy link
Collaborator

Choose a reason for hiding this comment

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

will quickly check but your work should allow to make it easy to suppress if there are more of those warnings

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.

Too many deprecation warnings cluttering the outputs
3 participants