Skip to content

Commit 1016a02

Browse files
committed
Fix skip and xfail id matching
For some reason the real nodeid has an extra "array-api-tests/" in front which breaks matching if we do a startswith match. "in" would also allow doing simpler matching with just the test name if desired.
1 parent fe878b0 commit 1016a02

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ def pytest_collection_modifyitems(config, items):
140140
markers = list(item.iter_markers())
141141
# skip if specified in skips file
142142
for id_ in skip_ids:
143-
if item.nodeid.startswith(id_):
143+
if id_ in item.nodeid:
144144
item.add_marker(mark.skip(reason=f"--skips-file ({skips_file})"))
145145
skip_id_matched[id_] = True
146146
break
147147
# xfail if specified in xfails file
148148
for id_ in xfail_ids:
149-
if item.nodeid.startswith(id_):
149+
if id_ in item.nodeid:
150150
item.add_marker(mark.xfail(reason=f"--xfails-file ({xfails_file})"))
151151
xfail_id_matched[id_] = True
152152
break

0 commit comments

Comments
 (0)