[TIP] Using coverage from API and command line gives different results

Ned Batchelder ned at nedbatchelder.com
Sat Feb 15 14:30:16 PST 2014


On 2/12/14 6:47 AM, Alexander Todorov wrote:
> I think I've figure it out.
>
> Adding source=['/usr/sbin/anaconda', 'pyanaconda'] produced the 
> results I wanted. Without it I see coverage report for all other 
> external modules loaded by anaconda but not pyanaconda (which is also 
> in site-packages).
>
> Can you explain why this is happening ?
I haven't tried to run it myself, but the source setting is usually the 
best way to control coverage.py's attention.  It tries to not measure 
"installed packages", but figuring out what is installed and what is not 
is difficult, and it often gets it wrong.

--Ned.
>
>
> If you'd still like to run the code try this:
>
> 1) Get a Fedora 20 DVD
> 2) Follow the instructions at
> http://atodorov.org/blog/2014/02/07/tip-how-to-build-updates.img-for-fedora/ 
>
>
> to build an updates.img   with the patch from
>
> https://www.redhat.com/archives/anaconda-devel-list/2014-February/msg00002.html 
>
>
>
> or alternatively use these (Fedora 20, x86_64):
> https://s3.amazonaws.com/atodorov/blog/updates_w_source_pyanaconda.img
> https://s3.amazonaws.com/atodorov/blog/updates_wo_source.img
>
> 3) Start the installer (in a virtual machine) and add to the boot 
> command line
> updates=http://path/to/updates.img
>
>
> 4) Perform a default installation
>
> 5) After install is complete and system has rebooted there should be a 
> /root/anaconda.coverage file.
>
>
>
> Try both updates.img and see the differences in the coverage results.
>
>
>




More information about the testing-in-python mailing list