Sweet! @nedbat released new #coveragepy supporting a dedicated `.coveragerc.toml` config in the default discovery mechanism!
I should now `pip install 'coverage >= 7.13.0'` everywhere!
It seems I'm among the people affected by a @coveragepy performance regression in python 3.14: https://github.com/coveragepy/coveragepy/issues/2082
Describe the bug Running our tests with coverage 7.11.3 is taking about twice as long as 7.11.0. This only occurs on Python 3.14. To Reproduce How can we reproduce the problem? Please be specific. ...
Anyone noticed tests running slower on Python 3.12 ? If you're using coverage.py, the quick fix is to set env variable COVERAGE_CORE=sysmon. Just got 3.5x speedup for my tests.
Ref: https://github.com/nedbat/coveragepy/issues/1665 and https://github.com/python/cpython/issues/107674
#python #python312 #coveragepy #pytest #coverage #pytest_cov
Сбор покрытия Flask (Python) в Runtime
Всем привет, меня зовут Осипов Станислав. Я занимаюсь AppSec/DevOps с 2021 года. В этой статье я хочу рассказать как можно собрать покрытие Python приложения в runtime (незавершая процесс). Что было использовано для сбора покрытия: https://github.com/pallets/flask - Flask 3.03 https://github.com/nedbat/coveragepy - coverage 7.5.1
Did you know that it is possible to do conditional code coverage analysis?
See: https://github.com/wemake-services/coverage-conditional-plugin
@coveragepy can now use Python 3.12's new sys.monitoring module with much lower overhead.
On 3.12, it's about the same as if you were running tests *without* coverage enabled!
https://nedbatchelder.com/blog/202312/coveragepy_with_sysmonitoring.html
With 7.4.2, you can set COVERAGE_CORE=sysmon globally on your CI, and it'll only use it where available (Python 3.12 and 3.13 alpha), and use the default for 3.11 and older.
For example, @pillow is 9% - 27% faster!