-
I'm working on an open source projected called GitCoin and have been trying to develop via TDD but the collection phase of pytest startup is taking an excruciatingly long time to complete. I added a pytest.ini that I had hoped would speed things up by ignoring many of the directories that did not contain tests and did get a 15s improvement (running a single file test went from 90s - 75s). We use docker for development and I am wondering if recursing through the filesystem in that context is causing the issue. I'm currently working on setting the app up without the container to see if that resolves it, but would appreciate any tips for ways we could improve the startup times, especially for the case of running a single file for active development on new features. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 15 replies
-
We have done some optimizations to the collection phase recently, that will be included in the pytest 7.0 release. If you can try installing pytest from git, I will be interested to know if it improves things for you. Other than that, we can look at profiles of collection on this project and see if anything stands out. To install pytest from git use BTW, which Python version and OS are you using? |
Beta Was this translation helpful? Give feedback.
We have done some optimizations to the collection phase recently, that will be included in the pytest 7.0 release. If you can try installing pytest from git, I will be interested to know if it improves things for you. Other than that, we can look at profiles of collection on this project and see if anything stands out.
To install pytest from git use
pip install git+https://github.com/pytest-dev/pytest.git
.BTW, which Python version and OS are you using?