[py-dev] New issue 1 in pytest-cov: Allow branch coverage

meme dough memedough at gmail.com
Sat Feb 26 08:42:16 CET 2011


Hi,

I'm cross posting to pytest and coverage to discuss.

At the start pytest-cov had command line options to control all of coverage.

Talk on pytest mailing list there was concern about so many options
and that it should have minimal options.  That way py.test --help
output is shorter and more useful as a single plugin doesn't output
huge amounts of text hiding the other plugin help text.  Also it could
be fully controlled through coverage config file.

We could add a small number of options in but I'd like to get others
opinions first.  Plus how do we decide which ones should be in or not.
 If we add branch then maybe someone else wants timid or cover pylib.

Another thing to consider is should coverage have env vars for all of
it's options.  That way it could be controlled from the command line
but independent of the test runner (pytest, nose, unittest2) and so it
would work with all of them. Something like:

{{{
COVERAGE_BRANCH=1 py.test --cov-report term-missing --cov myproj tests/
}}}

Or the following as coverage already reads COVERAGE_OPTIONS to get timid option:

{{{
COVERAGE_OPTIONS="--branch" py.test --cov-report term-missing --cov
myproj tests/
}}}

These days I quite like the minimal options with full control through
config file.  But I do see that it is nice to control through the
command line which is why I had full control of every option at the
very beginning (in fact I had command line option, env var, then
config file for each option).

Any ideas on leaving it as it is? Adding small number of options to
pytest-cov? Adding env vars to coverage to control independently so
works will all test runners?

:)

On 26 February 2011 08:36, Bitbucket <issues-noreply at bitbucket.org> wrote:
> --- you can reply above this line ---
>
> New issue 1: Allow branch coverage
> https://bitbucket.org/memedough/pytest-cov/issue/1/allow-branch-coverage
>
> jimslack on Fri, 25 Feb 2011 22:36:33 +0100:
>
> Description:
>  I know it is possible to activate branch coverage using a config file, but I'd like to use branch coverage with a command-line option.  Perhaps something like:
>
> {{{
> py.test --cov-report term-missing --cov --branch myproj tests/
> }}}
>
> or
>
> {{{
> py.test --cov-report term-missing --covbranch myproj tests/
> }}}
>
> Another possibility would be to make branch coverage the default.
>
> Thanks.
>
>
>
>
> --
>
> This is an issue notification from bitbucket.org. You are receiving
> this either because you are the owner of the issue, or you are
> following the issue.
>



More information about the Pytest-dev mailing list