Merge pull request #6986 from RonnyPfannschmidt/fix-6951-tw.writer-writable

fix #6951: allow to write TerminalReporter.writer
This commit is contained in:
Ronny Pfannschmidt
2020-03-30 21:51:06 +02:00
parent 554f600fb4
commit 38a4c7e56c
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))