[TIP] weird coverage problems with subprocesses - one down, one to go

Chris Withers chris at simplistix.co.uk
Thu May 28 01:05:54 PDT 2015


On 28/05/2015 07:47, Chris Withers wrote:
> When running the tests with nose locally, I get lots of:
>
> nosetests --with-cov --cov=picky
>
> 'picky.handlers',
>   'ERROR',
>   'pip gave errors: Error processing line 1 of 
> /Users/chris/.local/lib/python2.7/site-packages/init_cov_core.pth:\n\n 
> Traceback (most recent call last):\n    File 
> "/Users/chris/anaconda/envs/picky27/lib/python2.7/site.py", line 161, 
> in addpackage\n      exec line\n    File "<string>", line 1, in 
> <module>\n  ImportError: No module named cov_core_init\n\nRemainder of 
> file ignored\n'),
Well, my guess is this had to do with cov-core being installed in the 
root conda rather than a conda environment.
I've uninstalled and manually deleted the file; the problem is I have a 
feeling that I manually deleted that file before and it came back :-S

Still no idea why site.py is looking at 
/Users/chris/.local/lib/python2.7/site-packages/ in what's supposed to 
be an isolated environment...

> ...which makes no sense, as:
>
> $ /usr/bin/env python
> Python 2.7.9 |Continuum Analytics, Inc.| (default, Dec 15 2014, 10:37:34)
> [GCC 4.2.1 (Apple Inc. build 5577)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> Anaconda is brought to you by Continuum Analytics.
> Please check out: http://continuum.io/thanks and https://binstar.org
> >>> import cov_core_init
> >>>
>
> Now, running on Travis, I get different errors:
>
> https://travis-ci.org/Simplistix/picky/jobs/64213857
>
> The frustrating thing is that I don't get either of these problems 
> when running the tests with coverage under PyCharm.

...and of course, now I can't reproduce this one locally. I wonder 
what's different to cause coverage to care whether or not picky is 
imported when run remotely versus locally?

Chris




More information about the testing-in-python mailing list