Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
48 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
0 votes
1 answer
59 views

I have a test suite that runs a bunch of system tests on an API. Some system tests interact with the API by using Flask's test_client, whereas a few specific tests interact with the API by making HTTP ...
Arseni Mourzenko's user avatar
1 vote
0 answers
108 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
124 views

I discovered that when I run pytest with coverage, the coverage report shows that the tests do not fully cover the code, even though the tests execute the relevant code. Full Coverage Command (100% ...
jinhwan's user avatar
  • 1,227
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,677
1 vote
1 answer
27 views

I want to exclude tests directories, but include one file from the tests directory. Example .coveragerc: [run] omit = */tests/* !*/myapp/tests/my_file.py but I think coverage.py doesn't ...
dfrankow's user avatar
  • 21.7k
0 votes
1 answer
299 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
1 answer
103 views

In java we can generate code coverage report for manual testing by using Jacoco agent. Want to do the same for python application. We want to run the application on server, capture the manual testing ...
sapna kumari's user avatar
0 votes
0 answers
73 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
-3 votes
1 answer
238 views

I wrote code related to a website in python. Below is my file structure, ├── app_layer │   ├── src │   └── tests ├── core │   ├── src │   └── tests ├── model │   ├── src │   └── tests ├── .github │   ├...
rhar's user avatar
  • 9
1 vote
1 answer
114 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
1 answer
229 views

I'm using tox to run unit tests with pytest. When I run the tests with tox, it runs the tests and shows the tree of my src directory but prints CoverageWarning: No data was collected. (no-data-...
user1445709's user avatar
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
1 answer
106 views

I have a workflow that looks like this: on: push: branches: - master jobs: git_pull: runs-on: self-hosted steps: - name: executing remote ssh commands uses: appleboy/...
Yee Bee's user avatar
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
57 views

I was using unittest in Django to write tests and running the tests with this command: coverage run --omit='src/manage.py,src/config/*,*/.venv/*,*/*__init__.py,*/tests.py,*/admin.py' src/manage.py ...
cheslijones's user avatar
  • 9,304
0 votes
1 answer
303 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
0 votes
1 answer
962 views

I'm baffled by differences in coverage behavior for different files in my project and hope someone will please suggest how to debug this more effectively than I am doing now. This is basically the ...
chrisinmtown's user avatar
  • 4,492
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
0 votes
1 answer
38 views

Is there a way to have coverage only list functions that never get called? This is more to prune dead code than to enhance unit tests. For example, given the following test.py, we can see that c will ...
JL Peyret's user avatar
  • 12.2k
2 votes
1 answer
340 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,915
0 votes
1 answer
75 views

I'm running a coverage report in python and i created a .coveragerc file. I have two classes for example: class LinearRegression class LinearRegressionMLE when i instruct the coverage report to ...
turtle_in_mind's user avatar
0 votes
1 answer
901 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
53 views

I'm trying to get code coverage metrics in my IDE, but I can't seem to get the coverage to show right. It always shows up as no coverage. I am using the following in ~/.vim/ftplugin/ale.vim: Plug '...
Delta5's user avatar
  • 21
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
0 votes
1 answer
95 views

I have some code which uses a library that happens to use Cython under the hood. I'm observing that, following any call to a Cython function in that library, no lines in my own code are picked up as ...
alicederyn's user avatar
  • 13.3k
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
-2 votes
1 answer
142 views

This is kind of an followup question to How do I interpret Python coverage.py branch coverage results? I have a different situation where I check a variable perr which has in different scenarios, ...
MaKaNu's user avatar
  • 1,076
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
0 answers
306 views

I am currently having two issues involving coverage/pytest and gitlab CI. The bigger and more recent one is that pytest and coverage do nothing at all when i call them in the gitlab CI. I do not get ...
J.N.'s user avatar
  • 360
0 votes
1 answer
397 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
2 votes
1 answer
1k views

The Coverage tool supports generating code coverage data from Pytest tests with coverage run -m pytest .... However, there is also the Pytest-Cov plugin, which invokes Coverage and generates coverage ...
shadowtalker's user avatar
  • 14.1k
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
1 vote
1 answer
567 views

I'm running pytest with pytest-cov with the following command line: python -m pytest Mytools\tests --junitxml test_reports\unittest_result.xml --cov . --cov-branch --cov-report xml:test_reports\...
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
0 votes
1 answer
51 views

I am trying to increase my coverage percentage on my coverage report and there is this method that I want to write a test case for using an **assert ** statement. It is only one line, but for my test ...
cc10's user avatar
  • 1
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
0 votes
0 answers
424 views

Python 3.10 I'm working on my first Python project and am confused by the following output when I run coverage run -m pytest followed by venv/bin/coverage report --show-missing. I'm specifically ...
Jesse C.'s user avatar
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
1 answer
1k views

I have this python script snippet with mocked aws infrastructure for a todo list application: import os import boto3 import time import uuid import json import functools from botocore.exceptions ...
javier's user avatar
  • 1
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,160
0 votes
3 answers
636 views

I am trying to run python tests using coverage. However, when I try to run the command, the following error appears: $ python3 manage.py test Creating test database for alias 'default'... /workspace/....
megoverflow's user avatar
-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
0 answers
1k views

We have some test cases that are known to fail: those are in our backlog to complete. The tests that fail are not consistent. I have a separate branch that cleans this all up: but we need the coverage ...
WestCoastProjects's user avatar
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
1 vote
0 answers
258 views

I am implementing a reusable noxfile, my goal is that the different Python components of my project can have the same workflow for testing, linting, etc. To do this, I created a nox_plugin module ...
Kins's user avatar
  • 809
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
1 vote
1 answer
824 views

Consider the following example file test.py: def fun(l): for i in l: a = 1 print(a) if __name__ == '__main__': fun([1]) Testing branch coverage with coverage erase; coverage run -...
jakun's user avatar
  • 674
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
0 votes
1 answer
182 views

As discussed here, code coverage tools do not work nicely with tensorflow due to its code transformation. One suggested workaround is to use tf.config.experimental_run_functions_eagerly(True) when ...
Uri Granta's user avatar
  • 1,984

1
2 3 4 5
11