Why isn't --cover-branches working?

296 views
Skip to first unread message

cool-RR

unread,
Jan 20, 2011, 5:10:00 PM1/20/11
to nose-...@googlegroups.com
Hello,

I read this blog post from a year ago about `--cover-branches`:


I tried it with nose 1.0.0, but I get this:

    nosetests-script.py: error: no such option: --cover-branches

Why is that happening?


Thanks,
Ram.

David Stanek

unread,
Jan 20, 2011, 6:43:19 PM1/20/11
to nose-...@googlegroups.com

I don't think that nose has the changes that I made.

> --
> You received this message because you are subscribed to the Google Groups "nose-users" group.
> To post to this group, send email to nose-...@googlegroups.com.
> To unsubscribe from this group, send email to nose-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nose-users?hl=en.
>

cool-RR

unread,
Jan 21, 2011, 2:41:55 AM1/21/11
to nose-users
Does anyone know why? I understand that the code has been written, has it just not been merged? Has it been tested?
--
Sincerely,
Ram Rachum

Ned Batchelder

unread,
Jan 21, 2011, 8:59:48 AM1/21/11
to nose-...@googlegroups.com, cool-RR
Create a .coveragerc file that has

    [run]
    branch=True

--Ned.

jason pellerin

unread,
Jan 21, 2011, 9:27:30 AM1/21/11
to nose-...@googlegroups.com
nose's builtin coverage plugin was supposed to have been superseded by
one included coverage itself. I'm not sure exactly what happened with
that, though -- only that I stopped taking patches for nose's plugin
at some point because the new combined nose/py.test coverage plugin
was replacing it. Looking for that now though I don't seem to find it,
so I'm unsure of what's going on there or whether I should take those
patches for nose after all.

JP

Ned Batchelder

unread,
Jan 21, 2011, 10:17:47 AM1/21/11
to nose-...@googlegroups.com, jason pellerin
I started on a plugin, but it's outside my expertise, and it quickly
became clear that other test runners (py.test, trial, etc) should get
plugins too, and I didn't know how to test it, and I didn't know how to
package it, and etc, etc.

It's clear that this is something people want. I've advocated running
nose inside of coverage instead of the other way around, but it's more
natural to think of coverage testing as an option to enable on your
regular tests, rather than as the core of what's happening.

If someone wants to join the coverage project as an owner of the
plugins, and can help with all the ancillary issues, I'd be glad to try
again.

--Ned.

cool-RR

unread,
Jan 22, 2011, 4:09:54 AM1/22/11
to Ned Batchelder, nose-users
So when I do that, I'll get branch coverage without specifying the `--cover-branches` option? And will it show up in the xml report?
--
Sincerely,
Ram Rachum

Ned Batchelder

unread,
Jan 22, 2011, 8:18:38 AM1/22/11
to nose-...@googlegroups.com, cool-RR
You should do a quick test run to be sure, but yes, one of the reasons I added .coveragerc as a way to specify options was specifically so I could add features to coverage, and people running coverage as an option in test runners like nose could use the new features without waiting for the plugins to add yet more command-line options.

--Ned.

cool-RR

unread,
Jan 22, 2011, 8:49:20 AM1/22/11
to Ned Batchelder, nose-users
Wonderful, it's working. I think I'm gonna use that instead of specifying --cover-erase, --cover-package, etc. This is much more convenient.


Ram.
--
Sincerely,
Ram Rachum

cool-RR

unread,
Jan 22, 2011, 8:58:27 AM1/22/11
to Ned Batchelder, nose-users
Oh, now I see there's no option for `--cover-erase` in `.coveragerc`. It will be nice to have one.


Ram.
--
Sincerely,
Ram Rachum

David Stanek

unread,
Jan 22, 2011, 12:03:30 PM1/22/11
to nose-...@googlegroups.com
On Fri, Jan 21, 2011 at 10:17 AM, Ned Batchelder <n...@nedbatchelder.com> wrote:
>
> If someone wants to join the coverage project as an owner of the plugins,
> and can help with all the ancillary issues, I'd be glad to try again.
>

Hey Ned,

I don't mind helping out with the plugins again. Are you still looking
to include the plugins in the coverage package?


--
David
blog: http://www.traceback.org
twitter: http://twitter.com/dstanek

Reply all
Reply to author
Forward
0 new messages