[TIP] coverage.py with Py2 and Py3

Sean Robinson seankrobinson at gmail.com
Sat Apr 9 07:39:40 PDT 2011


  Hello all,

  I am developing a Python library for Py2 and Py3 in a single code
base.  I have begun using coverage.py and it has highlighted several
bugs and pointless code.  In the Py2 code paths only.

  How can I install coverage.py for use in both Py2 and Py3?  I
installed coverage.py for Py2, but it looks like installing it in Py3,
also, will overwrite the script launcher to use Py3.  Is there a way
to use coverage.py in both, serially?  Does anyone have any pointers
to more info?

  I am using coverage with stdlib unittest, so:

       coverage run --branch ./setup.py test

  and

       coverage html

  give me an excellent report of my Py2 problems and successes.  Thank you, Ned.


-- 
Sean Robinson
WiFi Radar - http://wifi-radar.berlios.de
Python WiFi - http://pythonwifi.wikispot.org
pymnl - http://pymnl.wikispot.org



More information about the testing-in-python mailing list