Skip to content

Change RemovedInPytest4Warnings to errors by default #4349

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

Merged
merged 2 commits into from
Nov 13, 2018

Conversation

nicoddemus
Copy link
Member

To keep existing tests which emit RemovedInPytest4Warnings running, decided
to go with a command line option because:

  • Is harder to integrate an ini option with tests which already use an ini file
  • It also marks tests which need to be removed/updated in 4.1, when
    RemovedInPytest4Warning and related functionality are removed.

Fix #3737

@nicoddemus nicoddemus force-pushed the pytest4-warnings-as-errors branch from 8dd5ca7 to 748ac78 Compare November 8, 2018 23:12
@codecov
Copy link

codecov bot commented Nov 8, 2018

Codecov Report

Merging #4349 into features will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##           features    #4349      +/-   ##
============================================
+ Coverage     95.84%   95.84%   +<.01%     
============================================
  Files           111      111              
  Lines         24928    24954      +26     
  Branches       2438     2440       +2     
============================================
+ Hits          23892    23918      +26     
  Misses          737      737              
  Partials        299      299
Flag Coverage Δ
#docs 29.11% <4.65%> (+0.17%) ⬆️
#doctesting 29.11% <4.65%> (+0.17%) ⬆️
#linting 29.11% <4.65%> (+0.17%) ⬆️
#linux 95.63% <100%> (ø) ⬆️
#nobyte 91.85% <98.63%> (+0.63%) ⬆️
#numpy 93.03% <98.63%> (+51.4%) ⬆️
#pexpect 41.6% <13.95%> (-0.03%) ⬇️
#py27 94.03% <100%> (+0.02%) ⬆️
#py34 92.16% <98.63%> (+0.07%) ⬆️
#py35 92.17% <98.63%> (+0.07%) ⬆️
#py36 93.91% <100%> (ø) ⬆️
#py37 92.22% <98.63%> (+0.07%) ⬆️
#trial 93.03% <98.63%> (+51.4%) ⬆️
#windows 93.97% <100%> (+0.72%) ⬆️
#xdist 93.73% <100%> (+0.16%) ⬆️
Impacted Files Coverage Δ
testing/python/collect.py 99.29% <100%> (ø) ⬆️
testing/test_mark.py 97.17% <100%> (ø) ⬆️
testing/acceptance_test.py 98.28% <100%> (ø) ⬆️
testing/python/fixture.py 99.24% <100%> (ø) ⬆️
testing/test_terminal.py 100% <100%> (ø) ⬆️
testing/test_warnings.py 98.64% <100%> (+0.09%) ⬆️
src/_pytest/warnings.py 88.88% <100%> (+0.28%) ⬆️
testing/test_runner_xunit.py 100% <100%> (ø) ⬆️
testing/test_config.py 99.42% <100%> (ø) ⬆️
testing/test_stepwise.py 100% <100%> (ø) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b131214...f8f22d2. Read the comment docs.

@nicoddemus nicoddemus force-pushed the pytest4-warnings-as-errors branch 3 times, most recently from a498f80 to d9d9ec9 Compare November 12, 2018 17:47
To keep existing tests which emit RemovedInPytest4Warnings running, decided
to go with a command line option because:

* Is harder to integrate an ini option with tests which already use an ini file
* It also marks tests which need to be removed/updated in 4.1, when
  RemovedInPytest4Warning and related functionality are removed.

Fix pytest-dev#3737
@nicoddemus nicoddemus force-pushed the pytest4-warnings-as-errors branch from d9d9ec9 to dc20ded Compare November 12, 2018 18:11
Otherwise the tests will use tox's env cache which makes them flaky
@nicoddemus
Copy link
Member Author

Ready for review!

Copy link
Member

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Choose a reason for hiding this comment

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

the approach with the extra argument creates a little headache for me but on the flip side its a nice tool for various indications as you noted

practicality beats purity 👍

@@ -41,6 +41,14 @@ def test_success():
"""
)

# customize cache directory so we don't use the tox's cache directory, which makes tests in this module flaky
Copy link
Member

Choose a reason for hiding this comment

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

we ought to make this more general as i believe there are other bits that can and will affect that

its ok as a followup tho

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I will follow it up on #4378. 👍

@nicoddemus nicoddemus merged commit 8198e7c into pytest-dev:features Nov 13, 2018
@nicoddemus nicoddemus deleted the pytest4-warnings-as-errors branch November 13, 2018 10:31
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