Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
37 views

When the average test coverage threshold across multiple modules isn't met, pytest doesn't fail with a non-zero exit code, even though it should. My command: ❯ pytest --cov module1 --cov module2 --cov ...
Sam's user avatar
  • 325
1 vote
0 answers
104 views

In my class, I have some methods that can be overridden by subclasses, but do not need to be. I like to test my project and generate a coverage report using coverage.py. Because the method of the ...
502E532E's user avatar
  • 581
0 votes
0 answers
43 views

I'd like to run a coverage check with the following configuration: coverage is installed globally on the system (via pipx). pytest in installed inside the virtual environment of the project. (Inside ...
DarkTrick's user avatar
  • 3,683
0 votes
1 answer
289 views

The coverage run icon in the Test Explorer is not displayed in Visual Studio Code. Check snapshot. Is There a way to enable coverage on Visual Code interface? I'm using Python pytest and working ...
Michael's user avatar
  • 57
0 votes
0 answers
72 views

So I was integrating the diff-cover tool in my repository and found that it sometimes gives in a UI format that the line was tested or not tested in the PR -> File. Any idea how does this work? ...
Alidin Abylkasym uulu's user avatar
1 vote
1 answer
111 views

I am using coverage.py to measure the statement/code coverage of my test. There are two files that are being tested: example_solution.py created_unit_test.py "example_solution" contains a ...
rpommes's user avatar
  • 13
0 votes
0 answers
113 views

My code is importing several variables using os.environ. When I run 'coverage run' command for testing, it gives key error. Is there a way to provide env files to read env variables from there, or ...
Rishi's user avatar
  • 132
0 votes
0 answers
35 views

I'm just learning django testing. When I use 'Coverage' module to check which parts of my code is tested, it considers almost all of class-based-views as tested while I have commented out all of my ...
mohsenof's user avatar
  • 115
0 votes
1 answer
300 views

I'm interested in seeing what test triggers what code via the coverage tool. I followed the instruction https://coverage.readthedocs.io/en/latest/contexts.html#dynamic-contexts, to enable dynamic ...
Xiaoxuan Jin's user avatar
22 votes
3 answers
7k views

I'm trying to switch PublishCodeCoverageResults from @1 to @2. Because appeared warnig in pipeline ##[warning]New V2 version of task publishing code coverage results is available to all our customers ...
Eugene's user avatar
  • 221
2 votes
1 answer
337 views

I am trying to get coverage on a Python process spawned by pytest. Here are the steps I took: Create a sitecustomize.py module in my local site packages directory #/home/Olumide/.local/lib/python3....
Olumide's user avatar
  • 5,905
0 votes
1 answer
889 views

I am having trouble displaying the correct coverage info for unittest. I created a simple python file as such: simple.py that contains the following contents: def multiply(x, y): return x * y ...
turtle_in_mind's user avatar
0 votes
1 answer
60 views

After any call to a Cython library, no lines show up as covered, even though I have tests that are clearly covering the library calls. I even tested this by putting in a obligatory ...
Delta5's user avatar
  • 21
3 votes
0 answers
79 views

This is a flask app with a rather simple pytest setup. import subprocess import time import pytest from selenium import webdriver from selenium.webdriver.chrome.options import Options @pytest.fixture(...
Reimirno's user avatar
  • 188
0 votes
1 answer
449 views

When running tests with coverage using PyCharm on django (python) project, im having the following error: Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm 2023.1.2\...
Jorge Miguel Soares Lopes's user avatar
0 votes
1 answer
394 views

Consider the following simple program: # thingy.py import sys print("ready") for line in sys.stdin: print(line, end='') If I want to unit-test the program, I can stub out the side-...
Marcus Harrison's user avatar
3 votes
1 answer
1k views

my python project is composed of several different packages main_dir |- package_1 |- package_2 |_ package_3 i'm testing each package separately with pytest and pytest-cov python -m pytest package_1\...
Alberto B's user avatar
  • 650
6 votes
1 answer
2k views

When I run coverage run -m pytest tests/ followed by coverage report in the terminal I get the following error: No source for code: '/private/var/.../_remote_module_non_scriptable.py'. It seems like a ...
mckris's user avatar
  • 81
3 votes
1 answer
1k views

I have built unittests for my code and everything works fine when running them from vscode. Even running coverage run runs successfully. But when I try to run coverage report I get the following ...
Code Pope's user avatar
  • 5,459
1 vote
1 answer
8k views

I used in the pass pytest but wanted to use this time unittest instead. I use the integrated testframework from vscode and for testing it just runs fine. Further I wanted to use coverage. My structure ...
MaKaNu's user avatar
  • 1,076
0 votes
0 answers
147 views

I have written a small class and function and unit test case for them. from flask_restful import Resource class Calculator: def __init__(self, a, b ): self.a = a self.b = b ...
user3521180's user avatar
  • 1,150
-2 votes
1 answer
621 views

I wanted to use coveragepy combine to seperate .coverage files into one. For that I installed python and the coverage module via pip, afterwards then running this command. python -m coverage combine ....
NLion74's user avatar
  • 15
2 votes
1 answer
1k views

I am trying to send a Pull Request to an opensource library. But I keep getting ModuleNotFoundError: No module named 'coverage' This is the log in Github CI Run tox -e lint,py310-dj40 lint: freeze> ...
Kim Stacks's user avatar
  • 10.9k
5 votes
1 answer
7k views

I am using pytest to test my Python code. To test for code coverage (C0 coverage) I run pytest --cov and I can specify my desired coverage in my pyproject.toml file like this: [tool.coverage.report] ...
Kins's user avatar
  • 809
0 votes
2 answers
356 views

So I've been wanting to integrate code coverage in my tests and for that im using the coverage api. I have a exit handler which gets triggered on SIGINT, SIGTERM and SIGABRT signals: import logging ...
NLion74's user avatar
  • 15

1
2 3 4 5
11