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] Rename and move testing utilities under tests directory in each module #4047

Merged
merged 8 commits into from Oct 12, 2023

Conversation

ymzayek
Copy link
Member

@ymzayek ymzayek commented Oct 11, 2023

Changes proposed in this pull request:

  • Testing utilities are now under tests/_testing.py in each module where they exist. Happy to change the name but I didn't use any version of "utils" because there are utils.py files that are relevant to the module functionality as opposed to the testing and where they exist they are usually tested in tests/test_utils.py

@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 11, 2023

Codecov Report

Merging #4047 (8e3cd8c) into main (c018480) will decrease coverage by 0.04%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4047      +/-   ##
==========================================
- Coverage   91.59%   91.56%   -0.04%     
==========================================
  Files         145      143       -2     
  Lines       16238    16057     -181     
  Branches     3376     3332      -44     
==========================================
- Hits        14874    14703     -171     
+ Misses        817      811       -6     
+ Partials      547      543       -4     
Flag Coverage Δ
macos-latest_3.10 91.48% <100.00%> (-0.04%) ⬇️
macos-latest_3.11 91.48% <100.00%> (-0.04%) ⬇️
macos-latest_3.12 91.48% <100.00%> (-0.04%) ⬇️
macos-latest_3.8 91.44% <100.00%> (-0.04%) ⬇️
macos-latest_3.9 91.45% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.10 91.48% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.11 91.48% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.12 91.48% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.8 91.44% <100.00%> (-0.04%) ⬇️
ubuntu-latest_3.9 91.45% <100.00%> (-0.04%) ⬇️
windows-latest_3.10 91.43% <100.00%> (-0.04%) ⬇️
windows-latest_3.11 91.43% <100.00%> (?)
windows-latest_3.12 91.43% <100.00%> (-0.04%) ⬇️
windows-latest_3.8 91.38% <100.00%> (-0.04%) ⬇️
windows-latest_3.9 91.39% <100.00%> (-0.04%) ⬇️

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

Files Coverage Δ
nilearn/interfaces/fmriprep/tests/_testing.py 98.50% <ø> (ø)
...n/interfaces/fmriprep/tests/test_load_confounds.py 98.40% <100.00%> (ø)
...s/fmriprep/tests/test_load_confounds_components.py 100.00% <100.00%> (ø)
...ces/fmriprep/tests/test_load_confounds_strategy.py 100.00% <100.00%> (ø)
...rfaces/fmriprep/tests/test_load_confounds_utils.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@Remi-Gau
Copy link
Collaborator

What's you take on this one: https://github.com/nilearn/nilearn/blob/main/nilearn/_utils/testing.py ?

I suspect it is in a private module and contains testing utilities used for several other modules so it is fine where it is and named as it is. Just want to make sure we are on the same page.

@ymzayek
Copy link
Member Author

ymzayek commented Oct 12, 2023

What's you take on this one: https://github.com/nilearn/nilearn/blob/main/nilearn/_utils/testing.py ?

I suspect it is in a private module and contains testing utilities used for several other modules so it is fine where it is and named as it is. Just want to make sure we are on the same page.

Yes that's what I was thinking too. It doesn't fit the pattern of the others that are private to the testing of a specific module (with one or two functions being an exception like the generate_surf in nilearn/surface/tests/_testing being used in plotting/tests/test_surf_plotting)

@Remi-Gau
Copy link
Collaborator

OK we agree on this. Good to me then. Let's merge.

Thanks for taking care of this. This one has been itching my inner Marie Kondo for a while.

@Remi-Gau Remi-Gau merged commit 00fcbae into nilearn:main Oct 12, 2023
32 checks passed
@ymzayek ymzayek deleted the testing-utils-structure branch October 12, 2023 08:40
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.

Homogenize location and naming of testing utilities
2 participants