546 questions
1
vote
0
answers
48
views
Why doesn't pytest-cov fail with a non-zero exit code when code coverage threshold isn't met, when running on multiple directories?
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 ...
0
votes
1
answer
59
views
How do I selectively hide no-data-collected when using coverage.py?
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 ...
1
vote
0
answers
108
views
Exclude methods consisting of a single pass statement from coverage reports in python
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 ...
0
votes
0
answers
124
views
Coverage Discrepancies in pytest: Code Executed but Not Tracked
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% ...
0
votes
0
answers
43
views
How to run globally installed coverage on a package inside a virtual enviroment?
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 ...
1
vote
1
answer
27
views
Exclude directory but include file in coverage.py reports?
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 ...
0
votes
1
answer
299
views
The coverage run icon in the Test Explorer is not displayed in Visual Studio Code
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 ...
0
votes
1
answer
103
views
How to Generate pytest Code Coverage Report for Manual testing without writing unit test cases
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 ...
0
votes
0
answers
73
views
diff-cover changes the ui of an azure devops?
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?
...
-3
votes
1
answer
238
views
How to combine coverage.xml files for github action coverage report? [duplicate]
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
│ ├...
1
vote
1
answer
114
views
coverage.py always reports one missing statement but the html report doesen't show what the missing statement is
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 ...
0
votes
1
answer
229
views
no-data-collected when running tests with tox but not when running tests with pytest
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-...
0
votes
0
answers
113
views
Error while running coverage run because of os.environ in python
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 ...
0
votes
1
answer
106
views
How to log coverage report to logs or summary?
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/...
0
votes
0
answers
35
views
Why 'coverage' considers all of my class-based-views as tested?
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 ...