Skip to content
Advertisement

Tag: coverage.py

coverage in parallel used all cpu resource

I’m using coverage3.8, version 5.3 with C extension. I used command: coverage3.8 run –parallel-mode xxx.py and used htop to check the CPU usage. Then I found the CPU usage is off the chart. I wonder if there is a variable/option that can set/limit how many CPU nodes that coverage3.8 can use? Answer –parallel-mode just tells coverage to name the data

Coverage for one-liner if statement

Static code analyzers for Python do not generate branches in the following case (one-liner if). Is this by design? Even coverage gives 100% coverage even if only one case is tested. Can anyone please shed some light on this? Answer The first comment says “does not create a control structure.” I don’t know what that means. Whether it’s one line

How to exclude a file from coverage.py?

I use nosetest’s coverage.py plugin. Is it somehow possible to exclude entire files or folders from the coverage report? My use case is having an external library in my project folder that obviously isn’t covered by my test suite. Answer Yeah, they have pretty extensive support for this in the docs. When running your code, the coverage run command will

Advertisement