Skip to content

Commit df68cd9

Browse files
rascaniclaude
andauthored
Backend test suite: Wire skip_patterns into pytest collection (#17982)
### Summary TestFlow already has skip_patterns and should_skip_test(), but they were dead code — never called from conftest.py. Add a pytest_collection_modifyitems hook that applies pytest.mark.skip when a flow's skip_patterns match the test name. This activates skip_patterns for all flows (CoreML, Vulkan, etc.). Co-authored-by: Claude <noreply@anthropic.com>
1 parent da2223f commit df68cd9

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

backends/test/suite/conftest.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@
44
import pytest
55
import torch
66

7-
from executorch.backends.test.suite.flow import all_flows
7+
from executorch.backends.test.suite.flow import all_flows, TestFlow
88
from executorch.backends.test.suite.reporting import _sum_op_counts
99
from executorch.backends.test.suite.runner import run_test
1010

1111

12+
def pytest_collection_modifyitems(config, items):
13+
for item in items:
14+
callspec = getattr(item, "callspec", None)
15+
if callspec is None:
16+
continue
17+
flow = callspec.params.get("test_runner")
18+
if not isinstance(flow, TestFlow):
19+
continue
20+
test_name = item.originalname or item.name
21+
if flow.should_skip_test(test_name):
22+
item.add_marker(
23+
pytest.mark.skip(reason=f"Skipped by {flow.name} skip_patterns")
24+
)
25+
26+
1227
def pytest_configure(config):
1328
backends = set()
1429

0 commit comments

Comments
 (0)