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

@@ -8,6 +8,7 @@ import sys
import _pytest._code
import pytest
from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG
try:
breakpoint
@@ -818,7 +819,9 @@ class TestTraceOption:
yield is_equal, 1, 1
"""
)
child = testdir.spawn_pytest("--trace " + str(p1))
child = testdir.spawn_pytest(
"{} --trace {}".format(SHOW_PYTEST_WARNINGS_ARG, str(p1))
)
child.expect("is_equal")
child.expect("Pdb")
child.sendeof()