Skip to content

Commit

Permalink
Optimize test order (fewer model reloads)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 13, 2024
1 parent bedd68a commit 9f78a4c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ def pytest_addoption(parser):
parser.addoption("--benchmark", action="store_true")


def pytest_collection_modifyitems(session, config, items: list[pytest.Item]):
def order(item: pytest.Item):
if not item.parent or "test_workflow" not in item.parent.name:
return 0
if "cloud" in item.name and "sdxl" in item.name:
return 4
elif "cloud" in item.name:
return 3
elif "sdxl" in item.name:
return 2
else:
return 1

items.sort(key=order)


class QtTestApp:
def __init__(self):
self._app = QCoreApplication([])
Expand Down

0 comments on commit 9f78a4c

Please sign in to comment.