Skip to content

Commit 9f78a4c

Browse files
committed
Optimize test order (fewer model reloads)
1 parent bedd68a commit 9f78a4c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/conftest.py

+16
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ def pytest_addoption(parser):
2121
parser.addoption("--benchmark", action="store_true")
2222

2323

24+
def pytest_collection_modifyitems(session, config, items: list[pytest.Item]):
25+
def order(item: pytest.Item):
26+
if not item.parent or "test_workflow" not in item.parent.name:
27+
return 0
28+
if "cloud" in item.name and "sdxl" in item.name:
29+
return 4
30+
elif "cloud" in item.name:
31+
return 3
32+
elif "sdxl" in item.name:
33+
return 2
34+
else:
35+
return 1
36+
37+
items.sort(key=order)
38+
39+
2440
class QtTestApp:
2541
def __init__(self):
2642
self._app = QCoreApplication([])

0 commit comments

Comments
 (0)