summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2020-08-17 17:46:47 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2020-08-19 08:13:34 -0300
commit457d351941279cd4d93d9fe9a622aa001b9e322e (patch)
tree6544bfa92c68e3b073034c669b3cbf27dcc9ea61 /testing
parent345a59dd53cc07488d2b3939da3240d978e1394e (diff)
downloadpytest-457d351941279cd4d93d9fe9a622aa001b9e322e.tar.gz
Remove deprecated TerminalReporter.writer property
Diffstat (limited to 'testing')
-rw-r--r--testing/deprecated_test.py31
1 files changed, 0 insertions, 31 deletions
diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py
index fb591d7d9..5660b312a 100644
--- a/testing/deprecated_test.py
+++ b/testing/deprecated_test.py
@@ -1,10 +1,8 @@
-import copy
import warnings
from unittest import mock
import pytest
from _pytest import deprecated
-from _pytest.config import Config
from _pytest.pytester import Testdir
@@ -36,35 +34,6 @@ def test_pytest_collect_module_deprecated(attribute):
getattr(pytest.collect, attribute)
-def test_terminal_reporter_writer_attr(pytestconfig: Config) -> None:
- """Check that TerminalReporter._tw is also available as 'writer' (#2984)
- This attribute has been deprecated in 5.4.
- """
- try:
- import xdist # noqa
-
- pytest.skip("xdist workers disable the terminal reporter plugin")
- except ImportError:
- pass
- terminal_reporter = pytestconfig.pluginmanager.get_plugin("terminalreporter")
- original_tw = terminal_reporter._tw
-
- with pytest.warns(pytest.PytestDeprecationWarning) as cw:
- assert terminal_reporter.writer is original_tw
- assert len(cw) == 1
- assert cw[0].filename == __file__
-
- new_tw = copy.copy(original_tw)
- with pytest.warns(pytest.PytestDeprecationWarning) as cw:
- terminal_reporter.writer = new_tw
- try:
- assert terminal_reporter._tw is new_tw
- finally:
- terminal_reporter.writer = original_tw
- assert len(cw) == 2
- assert cw[0].filename == cw[1].filename == __file__
-
-
@pytest.mark.parametrize("plugin", sorted(deprecated.DEPRECATED_EXTERNAL_PLUGINS))
@pytest.mark.filterwarnings("default")
def test_external_plugins_integrated(testdir, plugin):