Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No source for code" message in Coverage.py

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.

like image 475
Matt Norris Avatar asked Mar 05 '10 13:03

Matt Norris


1 Answers

I'm not sure why it thinks that file exists, but you can tell coverage.py to ignore these problems with a coverage xml -i switch.

If you want to track down the error, drop me a line (ned at ned batchelder com).

like image 58
Ned Batchelder Avatar answered Sep 30 '22 15:09

Ned Batchelder