File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,22 @@ def xp_has_ext(ext: str) -> bool:
118
118
return False
119
119
120
120
121
+ def check_id_match (id_ , pattern ):
122
+ if id_ == pattern :
123
+ return True
124
+
125
+ if id_ .startswith (pattern .removesuffix ("/" ) + "/" ):
126
+ return True
127
+
128
+ if pattern .endswith (".py" ) and id_ .startswith (pattern ):
129
+ return True
130
+
131
+ if id_ .split ("::" , maxsplit = 2 )[0 ] == pattern :
132
+ return True
133
+
134
+ return False
135
+
136
+
121
137
def pytest_collection_modifyitems (config , items ):
122
138
# 1. Prepare for iterating over items
123
139
# -----------------------------------
@@ -165,13 +181,13 @@ def pytest_collection_modifyitems(config, items):
165
181
markers = list (item .iter_markers ())
166
182
# skip if specified in skips file
167
183
for id_ in skip_ids :
168
- if id_ in item .nodeid :
184
+ if check_id_match ( item .nodeid , id_ ) :
169
185
item .add_marker (mark .skip (reason = f"--skips-file ({ skips_file } )" ))
170
186
skip_id_matched [id_ ] = True
171
187
break
172
188
# xfail if specified in xfails file
173
189
for id_ in xfail_ids :
174
- if id_ in item .nodeid :
190
+ if check_id_match ( item .nodeid , id_ ) :
175
191
item .add_marker (mark .xfail (reason = f"--xfails-file ({ xfails_file } )" ))
176
192
xfail_id_matched [id_ ] = True
177
193
break
You can’t perform that action at this time.
0 commit comments