Skip to content

Commit 54f4655

Browse files
committed
fix tests
1 parent 0907a0b commit 54f4655

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/unit/test_plugin_logging.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ def run_pytest(tmp_path, test_source, extra_args=None):
1919
test_file = tmp_path / "test_sample.py"
2020
test_file.write_text(textwrap.dedent(test_source))
2121

22+
# Register any custom marks used in test sources so that PYTHONWARNINGS=error
23+
# (set by CI) doesn't turn PytestUnknownMarkWarning into a fatal collection error.
24+
conftest = tmp_path / "conftest.py"
25+
conftest.write_text(
26+
textwrap.dedent(
27+
"""\
28+
def pytest_configure(config):
29+
config.addinivalue_line("markers", "smoke: smoke tests")
30+
config.addinivalue_line("markers", "regression: regression tests")
31+
"""
32+
)
33+
)
34+
2235
# Actual path where the plugin will write the report
2336
report_file = tmp_path / HTML_OUTPUT / REPORT_FILENAME
2437

0 commit comments

Comments
 (0)