简体   繁体   中英

How to speed up large test-suite run duration using pytest?

I have a pytest test-suite which contains over 30,000 test cases. When I run it, it takes over 10 hours to run.

However, when I cut the number of test cases down to 1,000, it completes in 39 seconds!

Any idea on what is going on here? The test cases are very simple, just calling one function which is doing no I/O (no network calls, DB calls etc).

Any help would be great!

Best,

Dave.

Turns out the issue was the size of the test files. After splitting the test cases across multiple smaller files, there was a huge increase in speed!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM