Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
1k views

I am trying to run coverage on a django project inside of a virtual environment and am having some issues with ModuleNotFoundError. As per this answer I have installed coverage inside of the virtual ...
omar_hussein's user avatar
1 vote
0 answers
1k views

I have project which tox.ini as below [tox] envlist = unittest,functional,lint skipsdist = True sitepackages = False [testenv] setenv = TESTING = True deps= -rrequirements.txt -rtox-...
NPatel's user avatar
  • 21.4k
2 votes
2 answers
724 views

I have the following configuration in tox: [tox] envlist = py37 [testenv] passenv = TRAVIS TRAVIS_* setenv = DEFAULT_FROM = [email protected] DEFAULT_SERVER = mock_server basepython = ...
Sid Premkumar's user avatar
0 votes
1 answer
373 views

Sample code: #!/usr/bin/env python import os import sys from coverage import Coverage class Cover_Diy(object): def cover_diy(self, cmd): if cmd == "hostname": os.system(cmd) ...
ted's user avatar
  • 1
1 vote
1 answer
1k views

I am using Coverage.py package to collect the coverage report. For now, I am collect the coverage report by running two commands like below: venv) ☁ python-codelab [master] ⚡ coverage run /Users/...
Lin Du's user avatar
  • 104k
4 votes
0 answers
3k views

I have a Django project with multiple applications. In one application, I have a library already tested using unittest + coverage. When I run the test of the django project, I would like to omit this ...
Nicolas M.'s user avatar
  • 1,488
4 votes
4 answers
948 views

Situation: I'm attempting to get coverage reports on all python code in my current project. I've utilized Coverage.py with great success for the most part. Currently I'm using it like this taking ...
While-E's user avatar
  • 1,565
1 vote
0 answers
443 views

We have a product with multiple python scripts which executes as different processes, sub-processes, daemons and on apache using mod-wsgi. The product runs on top of debian 9 and the scripts are ...
PythonUser's user avatar
2 votes
1 answer
743 views

I need to write test using unittest in python that fails when coverage is less than 50 percent. Such as: class ExampleTest(unittest.TestCase): def setUp(self): cov = coverage.Coverage() cov....
yars's user avatar
  • 43
1 vote
1 answer
1k views

I've project whose directory structure looks like below ProjectRoot - Module1 src/ tests/ - Module2 src/ tests/ ... From the root directory I want to run ...
Ganesh Satpute's user avatar
2 votes
0 answers
410 views

When I run the command coverage report -m after running coverage run main.py any of the lines in the methods that I have test are covered, I using a context.py file and I have the following project ...
RdTek's user avatar
  • 121
7 votes
3 answers
18k views

I installed coverage gutter extension for visual studio code but is not showing the line coverage, when I press Coverage Gutter display coverage or press the "watch" option in the footer it says "...
RdTek's user avatar
  • 121
17 votes
3 answers
5k views

I have a python project where I use: pipenv tox pytest and many more. Basically, I want to add tox to my gitlab pipelines. And almost everything seems to work, calling mypy, flake8 or black from tox ...
dabljues's user avatar
  • 1,997
7 votes
1 answer
2k views

Having trouble getting this implementation down. What I need: Code coverage results on my existing flask application, preferably using unit tests compatible with pytest. What I am seeing: I am ...
Liquidmetal's user avatar
3 votes
2 answers
3k views

With unittest and Coverage.py, def add_one(num: int): num = num + 1 return num from unittest import TestCase from add_one import add_one class TestAddOne(TestCase): def test_add_one(...
ci11y's user avatar
  • 31
2 votes
2 answers
2k views

When I run pytest --cov I get a coverage value of ~60%. The report generated on codecov.io after the code is pushed to github shows 100%. I cannot understand how the two are different, I thought the ...
Robin Long's user avatar
2 votes
3 answers
2k views

I'm running pytest-cov and pytest-django using tox. I have a very simple tox.ini file with limited omit files. The problem is when I run pytest using tox -e unit, I get a limited Coverage report: ----...
Blairg23's user avatar
  • 12.2k
1 vote
1 answer
267 views

After running all my tests with coverage on PyCharm, I need to export coverage report as html. When I do this, the entire venv folder is included even though it is marked to be excluded in the project ...
rodrigocf's user avatar
  • 2,159
7 votes
1 answer
4k views

I am using coverage.py to check the code coverage of my unit tests, in form of html report. coverage run -m pytest coverage html The report is pretty cool which shows the overall coverage % and the ...
henrywongkk's user avatar
  • 1,908
4 votes
1 answer
5k views

Pytest + coverage are showing very strange coverage statistics. They are counting only those modules where tests were added, but other Python modules are not calculated for some reason. I have a ...
pythonista's user avatar
2 votes
0 answers
709 views

My goal is to reach 100% coverage on unit tests I'm writing (Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32) The code I'm testing has exit ...
user2723494's user avatar
  • 1,228
0 votes
1 answer
2k views

I encounter the following error during reporting html coverage. myrepo>coverage report html html NoSource: No source for code: 'C:\Users\usr\AppData\Local\Programs\Python\Python37-32\Lib\html': [...
betontalpfa's user avatar
  • 3,846
18 votes
3 answers
13k views

AFAIK the feature "test coverage" is only available in the professional version (code-coverage). How to see code coverage of my tests with the PyCharm community version?
guettli's user avatar
  • 27.7k
1 vote
1 answer
2k views

Here's my .coveragerc include = */<project-dir>/* My sample script: echo "Running unit tests along with coverage" coverage run -m pytest echo "printing coverage report" ls -al echo "getting ...
Aqua267's user avatar
  • 953
2 votes
2 answers
5k views

I may be missing something obvious here, but I don't seem to be able to get coverage to load configuration data from a .coveragerc file when being used as an imported module, although it does seem to ...
AlexMedeiros's user avatar
3 votes
2 answers
3k views

If I invoke python3 -m coverage run ... inside a docker container, I get a .coverage file as desired. However, if I try to generate the html or text reports using that .coverage file outside of the ...
dstromberg's user avatar
  • 7,243
5 votes
3 answers
6k views

I have a very basic questing regarding Python coverage tests using PyCharm IDE. In my Django models, all the __str__ methods are not covered in my tests. class Category(models.Model): name = ...
PythonSherpa's user avatar
  • 2,600
2 votes
0 answers
693 views

I have a Python application I'm running within a Docker container. That application is normally started with the command /usr/local/bin/foo_service, which is a Python entry point (so it's just a ...
Nick Williams's user avatar
4 votes
2 answers
1k views

I'm using coverage module in python to check the code coverage. However, while running 'coverage report', the module is analyzing unwanted files shown below other than the project files. How can I ...
Tony Mathew's user avatar
2 votes
1 answer
683 views

I've been trying to integrate code-coverage in my Django application.. The build is successfull and all the tests are successfull but when i check coveralls.io or codecov.io there is no data.. I have ...
ABHISHEK TIWARI's user avatar
1 vote
0 answers
516 views

I am having troubles using the coverage.py module in my python script. The scenario is: I have a script which calls upon test scripts and executes them as this was the only way to call multiple tests ...
Josh Sullivan's user avatar
0 votes
2 answers
1k views

platform linux2, python 2.7.12-final-0 My integration tests ping an external server but I would like to change that to use a test fixture. I have been trying a few days to run a Thrift library TCP ...
Anthony O's user avatar
  • 672
7 votes
1 answer
8k views

I'm new to Gitlab, trying to setup coverage report -m for Gitlab. When I run manually, coverage report -m gives me the report. Just cant figure out what needs to be done to get that display on Gitlab. ...
dnrp's user avatar
  • 171
4 votes
1 answer
2k views

I am unable to run coverage.py in the tests directory from a Python project. I have a tests directory containing an __init__.py file and some test_*.py files where I define the tests I want to run in ...
alvarobartt's user avatar
23 votes
5 answers
16k views

I am trying to show a coverage badge for a Python project in a private Gitlab CE installation (v11.8.6), using coverage.py for Python. However, the badge always says unknown. This is the relevant job ...
Carsten's user avatar
  • 2,092
2 votes
1 answer
4k views

My code executes correctly using python3, but using coverage3 returns an ImportError when importing a package I created. My project looks as follows: components/common/ConfigTest/ConfigTest.py -> ...
Alejandro Villegas's user avatar
1 vote
0 answers
8k views

I am trying to add "Pragma: No Cover" to modules that do not require coverage. But coverage.py is only recognizing the comment in modules in the root folder. It does not work on modules that are ...
Souparno's user avatar
  • 360
0 votes
1 answer
163 views

I know coverage python package is capable of creating reports (in html) that show if pieces of code are covered by tests, or not. I can also run just a single individual test, and know what does it ...
Vini.g.fer's user avatar
1 vote
0 answers
303 views

Line below is the part of my manage.py code cov = coverage.Coverage(branch=True, include="app/*" But when i run test with coverage i received coverage for only two files ...
Emmanuel Mtali's user avatar
1 vote
1 answer
710 views

I'm new to Python. I am new to PyCharm. I am trying to debug through my unit tests. They are done with nosetest. Currently, when I run my tests with the vagrant debugger, it gives me the following ...
Christopher Pisz's user avatar
1 vote
1 answer
522 views

I am doing some coverage analyis on a code base that contains a fair amount of deprecated (using the deprecated package) methods. Most of these deprecated methods do not have any tests. So when doing ...
Ivo Merchiers's user avatar
4 votes
3 answers
15k views

I have the following code in test.py: import click @click.command() @click.option('--text', default='hello world', help='Text to display.') def say(text): print(text) if __name__ == "__main__": ...
Nicolas Berthier's user avatar
5 votes
0 answers
724 views

I am trying to use coveralls.io to show a coverage badge for my tests, but the coverage badge is stuck on "unknown". The relevant repo is here: https://github.com/Noah-Lc/simple-blog-rest-api When I ...
Nouh Belahcen's user avatar
5 votes
1 answer
8k views

I am trying to use the coverage tool to measure the code coverage of my Django app, when i test it work fine, but when i pushed to github, i got some errors in travis-ci: Traceback (most recent call ...
Nouh Belahcen's user avatar
0 votes
1 answer
29 views

I'm trying to use coverage.py on my unittest-based tests. I see that there are multiple kinds of paths and they're not collated, so the coverage data is wrong. /home/travis/virtualenv/python3.6.3/lib/...
Ark-kun's user avatar
  • 6,866
4 votes
0 answers
459 views

I want to test the coverage of a single package within a large body of software (specifically an Odoo addon). I have no control over the overall setup of the test. Hacking Odoo to start the coverage ...
manu's user avatar
  • 3,884
1 vote
1 answer
624 views

I have two different automation framework in python for my test cases Framework-1-is old and is going to be deprecated Framework-2-is New one with enhanced capabilities for time being i wanted to ...
PythonUser's user avatar
0 votes
1 answer
157 views

Searched the docs, but couldnt find a way to do this. I've been running my test suite with the following command: coverage manage.py run test tests This will run all tests in the 'tests' folder. ...
DannyMoshe's user avatar
  • 6,325
1 vote
1 answer
3k views

I am using tox to automatically run my tests using pytest and pytest-cov plugin. However, I'm getting coverage reports for the files I omitted in .coveragerc: (env) alex@smartalex-pc:~/.repos/codelib/...
adder's user avatar
  • 3,748
4 votes
1 answer
3k views

For the python coverage package, a missing else can be ignored for the resulting coverage by using # pragma: no branch. It seems, that this is not working when breaking a long if statement in ...
Igl3's user avatar
  • 5,108

1
3 4
5
6 7
11