Skip to content

Commit feafaae

Browse files
committed
Add on_start_tests to mark MIS order test as xfail
1 parent 94e5537 commit feafaae

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

nx_parallel/interface.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,30 @@ def should_run(cls, name, args, kwargs):
139139
return getattr(cls, name).should_run(*args, **kwargs)
140140

141141

142+
@staticmethod
143+
def on_start_tests(items):
144+
"""Modify pytest items after tests have been collected.
145+
146+
This is called during pytest_collection_modifyitems phase.
147+
Mark tests that have different valid behavior in parallel backend.
148+
"""
149+
try:
150+
import pytest
151+
except ModuleNotFoundError:
152+
return
153+
154+
xfail_tests = {
155+
"test_random_seed": (
156+
"test_mis.py",
157+
"Parallel MIS produces different valid ordering than sequential",
158+
),
159+
}
160+
161+
for item in items:
162+
for test_name, (filename, reason) in xfail_tests.items():
163+
if item.name == test_name and filename in str(item.fspath):
164+
item.add_marker(pytest.mark.xfail(reason=reason))
165+
166+
142167
for attr in ALGORITHMS:
143168
setattr(BackendInterface, attr, getattr(algorithms, attr))

0 commit comments

Comments
 (0)