-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Description
Splitting tests when using pytest
marker expressions is appearing to break the splitting. For example, I added this to a Django project that has a mixture of unit and functional tests. The functional tests are marked with @pytest.mark.browser
while other test have different or no marks. There are 347 tests with the marker. This is how the collection preformed when I split only the browser
tests:
pytest -m "browser" --splits 3 --group 1
[pytest-split] Running group 1/2
collected 5399 items / 5399 deselected
pytest -m "browser" --splits 2 --group 2
[pytest-split] Running group 2/2
collected 5399 items / 5052 deselected / 347 selected
Steps to reproduce
See test case in #18. If you execute this code with tryfirst=True
, one group will deselect all tests instead of splitting.
Proposal
See #18.
In summary, I think we should change pytest_collection_modifyitems
to trylast=True
instead of tryfirst=True
to fix the aforementioned bug and performance issue.
Metadata
Metadata
Assignees
Labels
No labels