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

[MRG] Pytest deprecations #1730

Merged
merged 4 commits into from Nov 16, 2022
Merged

[MRG] Pytest deprecations #1730

merged 4 commits into from Nov 16, 2022

Conversation

darcymason
Copy link
Member

@darcymason darcymason commented Nov 15, 2022

pytest 7.2 is now giving a large number of warnings about deprecated setup and teardown methods (which they say are nose tests and they will stop support for nose in future).

Their recommendation is to simply search/replace those names to setup_method and teardown_method, which is what this PR does.

  • Code typed and mypy shows no errors
  • Documentation updated (if relevant)
    • No warnings during build
    • Preview link (CircleCI -> Artifacts -> doc/_build/html/index.html)
  • Unit tests passing and overall coverage the same or better

* setup and teardown deprecated in pytest 7.2, rename to setup_method and teardown_method
@codecov
Copy link

codecov bot commented Nov 15, 2022

Codecov Report

Merging #1730 (351d513) into master (01ae3fc) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1730      +/-   ##
==========================================
+ Coverage   97.59%   97.61%   +0.01%     
==========================================
  Files          66       66              
  Lines       10769    10769              
==========================================
+ Hits        10510    10512       +2     
+ Misses        259      257       -2     
Impacted Files Coverage Δ
pydicom/filebase.py 99.19% <0.00%> (+1.61%) ⬆️

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

@darcymason darcymason changed the title Pytest deprecations [MRG] Pytest deprecations Nov 15, 2022
@@ -4,6 +4,8 @@ Version 2.4.0
Changes
-------
* Removed support for Python 3.6 (EOL since December 2021)
* In test suite, renamed 'setup' and 'teardown' methods,
Copy link
Member

Choose a reason for hiding this comment

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

I would put this under something like 'infrastructure' if at all, as this is not a change in pydicom, and the users are probably not interested in it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was wondering about that too. Perhaps we need a 'For pydicom developers' or 'Pydicom internals' section. I'll update that.

pydicom/tests/test_dataset.py Show resolved Hide resolved
@mrbean-bremen mrbean-bremen merged commit 7b3ed66 into master Nov 16, 2022
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.

None yet

2 participants