Only run logic for selected pytest items#156
Conversation
Small caveat: there's now an ordering contention between this and |
|
@nickodell would you mind trying this out for your SciPy development workflow? |
Sure, here is a quick benchmark. This is benchmarking the test command I measured this in two ways:
The results are the following.
It is significantly faster for this use case. |
|
Gentle ping - is this PR mergable? |
|
I was waiting for @lysnikolaou to look it over |
lysnikolaou
left a comment
There was a problem hiding this comment.
LGTM! This is a great improvement. Thanks @Liam-DeVoe!
Closes #153.
pytest_collection_finishis the right place to hook pytest for after exactly the tests we want have been selected. I don't think any pytest-run-parallel logic needs to execute for any non-selected item, so we can just wait until this stage in the process.Note the pytest docs claim
4. Set session.items to the list of collected itemscomes after3. pytest_collection_finish(session), but I'm pretty sure this is a docs bug on pytest's end, and these steps should be reversed; I'll send a PR their way.