coverage.py

combine python coverage files?

combine python coverage files? Question: I’m wondering if it’s possible to combine coverage.xml files into 1 file to see global report in HTML output. I’ve got my unit/functional tests running as 1 command and integration tests as the second command. That means my coverage for unit/functional tests are overridden by unit tests. That would be …

Total answers: 5

How to omit reporting files that have 100% coverage in Coverage.py

How to omit reporting files that have 100% coverage in Coverage.py Question: Is there a setting I can put in the .coveragerc file under [report] to omit files that have 100% test coverage in my report? The closest thing I found was the exclude_lines option, but this only works for a regex pattern inside the …

Total answers: 2

Making py.test, coverage and tox work together: __init__.py in tests folder?

Making py.test, coverage and tox work together: __init__.py in tests folder? Question: I’m having a weird problem with tox, py.test, coverage and pytest-cov: when py.test with the –cov option is launched from tox, it seems to require an __init__.py file in the tests folder which is not immediately obvious. While writing this post, I have …

Total answers: 2

coverage.py does not cover script if py.test executes it from another directory

coverage.py does not cover script if py.test executes it from another directory Question: I got a python script which takes command line arguments, working with some files. I’m writing succeeding tests with py.test putting this script through its paces, executing it with subprocess.call. Now I want to analyze code coverage with coverage.py. Coverage, when used …

Total answers: 4

Using py.test with coverage doesn't include imports

Using py.test with coverage doesn't include imports Question: For Jedi we want to generate our test coverage. There is a related question in stackoverflow, but it didn’t help. We’re using py.test as a test runner. However, we are unable to add the imports and other “imported” stuff to the report. For example __init__.py is always …

Total answers: 5

How to Fix Python Nose: Coverage not available: unable to import coverage module

How to Fix Python Nose: Coverage not available: unable to import coverage module Question: I can’t seem to get code coverage with Nose to work, despite having the plugin installed. Any ideas on how to fix this? 12:15:25 ~/sandbox/ec$ nosetests –plugins Plugin xunit Plugin deprecated Plugin skip Plugin multiprocess Plugin failuredetail Plugin capture Plugin logcapture …

Total answers: 2

Excluding abstractproperties from coverage reports

Excluding abstractproperties from coverage reports Question: I have an abstract base class along the lines of: class MyAbstractClass(object): __metaclass__ = ABCMeta @abstractproperty def myproperty(self): pass But when I run nosetests (which coverage) on my project, it complains that the property def line is untested. It can’t actually be tested (AFAIK) as instantiation of the abstract …

Total answers: 3

coverage.py: exclude files

coverage.py: exclude files Question: How do I exclude entire files from coverage.py reports? According to the documentation you can exclude code by matching lines. I want to exclude entire files, so that the reports don’t include 3rd party libraries. Am I missing something? Can it be done? Asked By: flybywire || Source Answers: You can …

Total answers: 5