Questions tagged [python-coverage]

Coverage.py is a tool for measuring code coverage of Python programs.

Coverage.py is a tool for measuring code coverage of Python programs. It monitors your program, noting which parts of the code have been executed, then analyzes the source to identify code that could have been executed but was not.

Coverage measurement is typically used to gauge the effectiveness of tests. It can show which parts of your code are being exercised by tests, and which are not.

See https://coverage.readthedocs.io/

54 questions
1
vote
1 answer

nosetests - excluding a dir from the coverage report

I have my python app structured as follows: proj - comp1 - comp2 tests - comp1 - comp2 other - contains some python code I am running nosetests as following: nosetests --with-coverage --cover-package=proj --exclude-dir=other -v…
vrtx54234
  • 2,196
  • 3
  • 30
  • 53
1
vote
1 answer

command line option to display coverage in python

When I use nose from terminal to display test result with coverage I get error and missing lines that are actually covered $ python -m nose.core test_utils.py -s --with-coverage saying…
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
1
vote
1 answer

run unit tests and coverage in certain python structure

I have some funny noob problem. I try to run unit tests from commandline: H:\PRO\pyEstimator>python src\test\python\test_power_estimator.py Traceback (most recent call last): File "src\test\python\test_power_estimator.py", line 2, in
bua
  • 4,761
  • 1
  • 26
  • 32
1
vote
2 answers

Changing the default version of python for Ned Batchelder's coverage tool

The title pretty much says it. I'm having problems connected to the change in the unittest python from python 2.5 to 2.7. When I run my test script with python python _tester.py it works fine. But when I try to use the coverage tool coverage…
Harrison
  • 830
  • 1
  • 15
  • 28
0
votes
1 answer

Coverage with nosetests not exiting

I have an instance of Atlassian Bamboo running that calls and creates a code coverage website using the coverage.py script. it calls: coverage run $(which nosetests) --with-xunit $test_files coverage html -D directory Today, a user introduced a…
Michael WS
  • 2,450
  • 4
  • 24
  • 46
0
votes
1 answer

Django functions definition in views.py not shown in coverage?

I am using coverage in the following way to test my django app: DJANGO_SETTINGS_MODULE=$(SETTINGS) coverage run manage.py test -v 2 DJANGO_SETTINGS_MODULE=$(SETTINGS) coverage report In my test suite I tests some views: class…
oz123
  • 27,559
  • 27
  • 125
  • 187
0
votes
0 answers

Python/Django Code Coverage doesn't cover classmethods

I'm using coverage.py to check the test/code coverage and it seems to consistently skip over any class methods. Is there a way to fix this?
user9903
0
votes
1 answer

Python nose throws TypeError error with coverage

When I am using the nosetests 1.2.1 with coverage, it throws the below error. /usr/lib/python2.6/site-packages/tw/core/view.py:223: DeprecationWarning: object.__new__() takes no parameters obj = object.__new__(cls, *args, **kw) Traceback (most…
vinay polisetti
  • 374
  • 1
  • 3
  • 15
0
votes
1 answer

How do I run python code-coverage on multiple platforms

I am using coverage.py on my code (python 2.7), inside PyDEV on Windows. I have bits of code that run only on UNIX, usually starting with: if os.name == 'posix': and I want to make sure this is covered as well. Somehow to run coverage on UNIX, and…
ModdyFire
  • 706
  • 3
  • 9
  • 19
1 2 3
4