Skip to content

Commit 21d6b9f

Browse files
committed
Be more lax about id names in xfail and skips files
Also include the file name in the reason.
1 parent 24f67f8 commit 21d6b9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ def pytest_collection_modifyitems(config, items):
128128
markers = list(item.iter_markers())
129129
# skip if specified in skips file
130130
for id_ in skip_ids:
131-
if item.nodeid.startswith(id_):
132-
item.add_marker(mark.skip(reason="skips file"))
131+
if id_ in item.nodeid:
132+
item.add_marker(mark.skip(reason=f"skips file ({skips_file})"))
133133
break
134134
# xfail if specified in xfails file
135135
for id_ in xfail_ids:
136-
if item.nodeid.startswith(id_):
137-
item.add_marker(mark.xfails(reason="xfails file"))
136+
if id_ in item.nodeid:
137+
item.add_marker(mark.xfail(reason=f"xfails file ({xfails_file})"))
138138
break
139139
# skip if disabled or non-existent extension
140140
ext_mark = next((m for m in markers if m.name == "xp_extension"), None)

0 commit comments

Comments
 (0)