Stylistic question regarding no-op code and tests

Jason Swails jason.swails at gmail.com
Thu Oct 15 08:55:26 EDT 2015


On Wed, Oct 14, 2015 at 10:07 PM, Ben Finney <ben+python at benfinney.id.au>
wrote:

> Jason Swails <jason.swails at gmail.com> writes:
>
> > What I recently realized, though, that what this construct allows is
> > for the coverage testing package (which I have recently started
> > employing for my project... thanks Ned and others!) to detect whether
> > or not both code paths are covered in the test suite.
>
> Coverage.py has, for many releases now, had good measurement of branch
> coverage by your tests. Enable it with the ‘--branch’ option to ‘run’
>

​Oh, cool.  I'm actually using coverage indirectly through nose, so I
haven't really looked through the coverage docs (although nosetests has a
--cover-branches option that toggles this feature).  Now I can go back to
cringing about "else: pass" in peace :).

Thanks!
Jason

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20151015/10b42d4c/attachment.html>


More information about the Python-list mailing list