From ac8027c43c9df4431092d633a06bd5bd92341247 Mon Sep 17 00:00:00 2001 From: Yogeswaran Umasankar Date: Sat, 20 Jan 2024 20:24:55 +0000 Subject: New upstream version 1:20240117 --- tests/conftest.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/conftest.py (limited to 'tests/conftest.py') diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..8026a98 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,15 @@ +import os + +import pytest + + +def pytest_collection_modifyitems(config, items): + xfails = os.path.join(os.path.dirname(__file__), 'xfails.txt') + with open(xfails) as f: + lines = [x.strip() for x in f.readlines() if not x.startswith('#')] + msg = ('Test marked for XFAIL in tests/xfails.txt, but did not fail. ' + 'If this test is now fixed, remove it from the file.') + for item in items: + if item.nodeid in lines: + mark = pytest.mark.xfail(reason=msg) + item.add_marker(mark) -- cgit v1.2.3