Comments (4)
I added the branch parameter and branch coverage can be seen in the report, but the
analysis
call to coverage still only gives me information about statement coverage.
('/tmp/test/src/main/python/foo/__init__.py', [1, 2, 3, 4, 5], [], '')
although
Name Stmts Miss Branch BrMiss Cover Missing
---------------------------------------------------
foo 5 0 4 2 78%
Not sure what I can do here. I'm definitely not parsing the report from coverage in either XML or HTML form.
I think this is a problem with coverage itself.
from pybuilder.
It's true: the coverage API (methods on the coverage object itself) don't have a way to get the branch numbers. Frankly, I was a little surprised to see this, and that yours is the first request for it! Most people dig into the code to find the information, which is both a little unfortunate and your only option at the moment.
If you look at the code for coverage.analysis(), it calls coverage._analysis(), which creates an Analysis object. That object has a .numbers attribute with the stats you're looking for.
I'm on the verge of undertaking a major overhaul of coverage.py, I'll take this need into account.
from pybuilder.
Thanks @nedbat !
I can definitely work with this, but you're going to have to wait a bit longer @aelgru !
from pybuilder.
This is resolved by #160 (https://github.com/pybuilder/pybuilder/pull/153/files#diff-62a96813032655a36d7cf13b53e2cea5R92)
Still no branch coverage in JSON output, not sure if it's necessary though.
from pybuilder.
Related Issues (20)
- There is no option to make Pybuilder use pre-release versions of modules when resolving dependencies with pip HOT 5
- Setuptools 62.2+ and twine require non-empty `long_description` HOT 16
- Python 3.11: remote process start fails in `_posixsubprocess.fork_exec` HOT 1
- The XML coverage report generated via PyBuilder can show wrong filenames and packages HOT 2
- pybuilder/terminal.py:135: ResourceWarning: unclosed file
- Python venv management needs to account for debug builds
- Should flake8 still be pinned?
- requests is not a dependency of pybuilder HOT 2
- distutils build_binary_distribution should run before "package" not "publish" HOT 2
- Problem in Windows OS HOT 3
- Module `imp` is not available in Python 3.12
- pybuilder does not run unit tests "correctly" - ModuleNotFoundError: No module named 'src' HOT 1
- pycharm: imports are unresolved but pyb works, also running the application works HOT 2
- support for netbeans or vscode HOT 4
- Specify Python version for virtual env HOT 4
- Newer versions of virtualenv causing clash with vendored virturalenv HOT 1
- Permission denied [Errno 13] when using source_distribution_plugin HOT 7
- Executing arbitrary shell command HOT 9
- SonarQube integration configuration HOT 10
- SonarQube passed ignoring test coverage threshold HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pybuilder.