Tests take longer to run when coverage context is recorded, expected?
See original GitHub issuePerhaps you are already aware of this and it is expected, but at least for the purpose of documenting it:
Running tests while recording coverage context for who-tests-what (by using the .coveragerc
mentioned below), takes considerably longer than usual. As a small example, running 300 unit tests used to take 15 seconds and with this it takes around 50 seconds. On bigger batches of tests it became quite impactful. Perhaps this is all expected.
The .coveragerc
file is:
[run]
dynamic_context = test_function
As described in https://nedbatchelder.com/blog/201810/who_tests_what_is_here.html
The command was:
python coverage run -p --branch /path/py.test tests/unit/module/
Measured on:
Python==3.6.5
coverage==5.0a4
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Test coverage visualization - GitLab Docs
Coverage files are parsed in a background job so there can be a delay between pipeline completion and the visualization loading on the...
Read more >Review test results - Azure Pipelines | Microsoft Learn
Tests, such as integration and functional tests, can run for a long time. Therefore, it is important to see the current or near...
Read more >TestCoverage - Martin Fowler
Test coverage is a useful tool for finding untested parts of a codebase. Test coverage is of little use as a numeric statement...
Read more >Improve Java Code Coverage and Quality with Unit Tests and ...
Rather than repeating yourself over and over, use a data-driven test to specify the expected inputs and the expected outputs. JUnit has built-in ......
Read more >Django Tutorial Part 10: Testing a Django web application
They may cover simple groupings of components through to the whole ... The class also owns a test Client that you can use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve made some more speed improvements on master. Can you try them?
pytest-cov is a pytest plugin for coordinating coverage measurement during test runs. It’s faster for two reasons: