"No source for code" message in Coverage.py

Matt Norris picture Matt Norris · Mar 5, 2010 · Viewed 9.7k times · Source

I ran a build last night, successfully. I got up this morning and ran another without changing any configuration or modifying any source code. Now my build is failing with the message "No source for code" when running my nosetests with coverage.

NoSource: No source for code: '/home/matthew/.hudson/jobs/myproject/workspace/tests/unit/util.py'
. . . 
No source for code: '/home/matthew/.hudson/jobs/myproject/workspace/__init__.py'

The only clue I have is that the files it says it can't find aren't there, but they never were and they're not supposed to be. For example, in the latter, Hudson's workspace isn't a Python module, so __init__.py wouldn't be there.

Update: I've confirmed that this isn't a Hudson issue. When I run nostests with coverage in the directory itself, I see similar messages. Again, the files that coverage is looking for were never there to begin with, making this very puzzling.

Answer

Ross picture Ross · Mar 8, 2010

Ensure theres no .pyc file there, that may have existed in the past.