Add temporary XFAIL test list

This is not to allow excluding drivers from tests, but rather to
allow for iterating towards fixes for specific issues. Do not add
new lines to this file without justification.
This commit is contained in:
Dan Smith 2023-11-05 10:10:44 -08:00 committed by Dan Smith
parent 90027b4850
commit 1ccf039871
2 changed files with 23 additions and 0 deletions

15
tests/conftest.py Normal file
View File

@ -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)

8
tests/xfails.txt Normal file
View File

@ -0,0 +1,8 @@
# This is a list of tests that are expected to fail. DO NOT add new things to
# this file without careful consideration and discussion. This is not a tool
# to avoid fixing failures, it is purely a stop-gap to allow temporary
# failures to avoid breaking the build while iterating towards a fix.
#
# One line per test nodeid with a comment above citing a bug number, example:
# Bug #10931: FT-450 mem.extra fields cause UI corruption
# tests/test_drivers.py::TestCaseBruteForce_Yaesu_FT-450D::test_mode