"No data was collected" running from site-packages

Issue #507 invalid
Former user created an issue

I'm running Python 2.7 on Windows 7.

I installed coverage using "pip install coverage".

I created C:\Python27\Lib\site-packages\foo\test.py: if name == 'main': print "hello world"

I ran coverage.py on it: c:\Python27\Lib\site-packages\foo>coverage run test.py hello world Coverage.py warning: No data was collected.

As a control, I moved test.py to C:\Python27\ and ran coverage on it there successfully.

Comments (2)

  1. Ned Batchelder repo owner

    I tried reproducing this in a virtualenv (on a Mac), and didn't see the effect you are seeing.

    In any case, you shouldn't be running code directly from either site-packages or from C:\Python27. You should have a directory dedicated to your project that is separate from those places.

  2. Log in to comment