Change RemovedInPytest4Warnings to errors by default

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
This commit is contained in:
Bruno Oliveira
2018-11-08 20:14:58 -02:00
parent b1312147e0
commit dc20dedbc7
17 changed files with 136 additions and 60 deletions

View File

@@ -7,6 +7,7 @@ from __future__ import division
from __future__ import print_function
import pytest
from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
def test_module_and_function_setup(testdir):
@@ -189,7 +190,8 @@ def test_method_generator_setup(testdir):
assert self.classsetup
assert self.methsetup == self.test_generate
assert value == 5
"""
""",
SHOW_PYTEST_WARNINGS_ARG,
)
reprec.assertoutcome(passed=1, failed=1)
@@ -219,7 +221,8 @@ def test_func_generator_setup(testdir):
assert x == [1]
yield check
assert x == [1]
"""
""",
SHOW_PYTEST_WARNINGS_ARG,
)
rep = reprec.matchreport("test_one", names="pytest_runtest_logreport")
assert rep.passed