|
14 | 14 | pytest_plugins = ("pytester",)
|
15 | 15 |
|
16 | 16 |
|
| 17 | +def handle_tr_writer_deprecation(): |
| 18 | + # Remove this function when they've fixed |
| 19 | + # https://github.com/pytest-dev/pytest/issues/6936 |
| 20 | + import warnings |
| 21 | + from _pytest.warnings import _setoption |
| 22 | + |
| 23 | + arg = "ignore:TerminalReporter.writer:pytest.PytestDeprecationWarning" |
| 24 | + _setoption(warnings, arg) |
| 25 | + |
| 26 | + |
17 | 27 | def run(testdir, path="report.html", *args):
|
| 28 | + # TODO: Temporary hack until they fix |
| 29 | + # https://github.com/pytest-dev/pytest/issues/6936 |
| 30 | + handle_tr_writer_deprecation() # TODO: Temporary hack |
18 | 31 | path = testdir.tmpdir.join(path)
|
19 | 32 | result = testdir.runpytest("--html", path, *args)
|
20 | 33 | return result, read_html(path)
|
@@ -219,6 +232,9 @@ def test_report_title(self, testdir, path):
|
219 | 232 | assert report_title in html
|
220 | 233 |
|
221 | 234 | def test_report_title_addopts_env_var(self, testdir, monkeypatch):
|
| 235 | + # TODO: Temporary hack until they fix |
| 236 | + # https://github.com/pytest-dev/pytest/issues/6936 |
| 237 | + handle_tr_writer_deprecation() |
222 | 238 | report_location = "REPORT_LOCATION"
|
223 | 239 | report_name = "MuhReport"
|
224 | 240 | monkeypatch.setenv(report_location, report_name)
|
@@ -878,6 +894,9 @@ def test_css_invalid(self, testdir, recwarn):
|
878 | 894 | assert "No such file or directory: 'style.css'" in result.stderr.str()
|
879 | 895 |
|
880 | 896 | def test_css_invalid_no_html(self, testdir):
|
| 897 | + # TODO: Temporary hack until they fix |
| 898 | + # https://github.com/pytest-dev/pytest/issues/6936 |
| 899 | + handle_tr_writer_deprecation() |
881 | 900 | testdir.makepyfile("def test_pass(): pass")
|
882 | 901 | result = testdir.runpytest("--css", "style.css")
|
883 | 902 | assert result.ret == 0
|
|
0 commit comments