fix #6951: allow to write TerminalReporter.writer

This commit is contained in:
Ronny Pfannschmidt
2020-03-30 21:31:53 +02:00
parent 211adfc945
commit eab2831671
4 changed files with 22 additions and 7 deletions
+8 -1
View File
@@ -36,8 +36,15 @@ def test_terminal_reporter_writer_attr(pytestconfig):
except ImportError:
pass
terminal_reporter = pytestconfig.pluginmanager.get_plugin("terminalreporter")
expected_tw = terminal_reporter._tw
with pytest.warns(pytest.PytestDeprecationWarning):
assert terminal_reporter.writer is terminal_reporter._tw
assert terminal_reporter.writer is expected_tw
with pytest.warns(pytest.PytestDeprecationWarning):
terminal_reporter.writer = expected_tw
assert terminal_reporter._tw is expected_tw
@pytest.mark.parametrize("plugin", sorted(deprecated.DEPRECATED_EXTERNAL_PLUGINS))