New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch coverage please #85

Closed
dimaqq opened this Issue Aug 25, 2015 · 7 comments

Comments

Projects
None yet
6 participants
@dimaqq

dimaqq commented Aug 25, 2015

Please allow turning on branch coverage.
IMO it should be the default too.

@ionelmc

This comment has been minimized.

Member

ionelmc commented Aug 25, 2015

You can enable branch coverage via .coveragerc. Do you really need a command line argument?

@alexamici

This comment has been minimized.

alexamici commented Jan 7, 2016

You may enable branch coverage in your setup.cfg file as well by adding:

[coverage:run]
branch = True
@JonasOlson

This comment has been minimized.

JonasOlson commented Dec 23, 2016

It looks like it used to be possible to turn on branch coverage easily with --cov-branch, just like you still use options like --cov-report or --cov-fail-under. Can we have that back?

@ionelmc

This comment has been minimized.

Member

ionelmc commented Dec 24, 2016

@JonasOlson yes but why? what's wrong with putting it in .coveragerc?

@Juanlu001

This comment has been minimized.

Juanlu001 commented Dec 24, 2016

@JonasOlson yes but why? what's wrong with putting it in .coveragerc?

Nothing wrong with it, but I agree with @JonasOlson and others that this option is too common to not have it available on the command line.

@JonasOlson

This comment has been minimized.

JonasOlson commented Dec 25, 2016

@ionelmc: The command line argument is useful for the same reason any other command line argument is. Being able to run a command should preferably not have to include first creating, or rewriting, a file describing that command. You might not even have write access, or you might be running commands with different options every time, perhaps simultaneously. A configuration file might make sense when you want to use the same complex options over and over again, but I don't think it should replace command line options.

@sashgorokhov

This comment has been minimized.

sashgorokhov commented Mar 4, 2017

Currently I have a two-line .coveragerc with

[run]
branch = True

in my several projects and this is boring. I really would like to have a command-line argument for this. I could even write a PR for this feature.

@ionelmc ionelmc closed this in #153 Mar 15, 2017

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue May 17, 2017

wiz
Updated py-test-cov to 2.5.1.
2.5.1 (2017-05-11)
------------------

* Fixed xdist breakage (regression in ``2.5.0``).
  Fixes `#157 <https://github.com/pytest-dev/pytest-cov/issues/157>`_.
* Allow setting custom ``data_file`` name in ``.coveragerc``.
  Fixes `#145 <https://github.com/pytest-dev/pytest-cov/issues/145>`_.
  Contributed by Jannis Leidel & Ionel Cristian Mărieș in
  `#156 <https://github.com/pytest-dev/pytest-cov/pull/156>`_.

2.5.0 (2017-05-09)
------------------

* Always show a summary when ``--cov-fail-under`` is used. Contributed by Francis Niu in `PR#141
  <https://github.com/pytest-dev/pytest-cov/pull/141>`_.
* Added ``--cov-branch`` option. Fixes `#85 <https://github.com/pytest-dev/pytest-cov/issues/85>`_.
* Improve exception handling in subprocess setup. Fixes `#144 <https://github.com/pytest-dev/pytest-cov/issues/144>`_.
* Fixed handling when ``--cov`` is used multiple times. Fixes `#151 <https://github.com/pytest-dev/pytest-cov/issues/151>`_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment