473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

coverage.py can't find source file

I am using coverage.py to run my unit test suite to check for missing
tests. It mostly works, but for some mysterious reason, some of the
files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

Anyone have any ideas?

--

- rmgw

<http://www.trustedmedianetworks.com/>

----------------------------------------------------------------------------
Richard Wesley Trusted Media Networks, Inc.

"I've got all this ironing to do and my diet pill is wearing off!"
- Devine, _Hairspray_
Jul 18 '05 #1
5 2001

"Richard Wesley" <ha******@trustedmedianetworks.com> wrote in message
news:ha****************************@tribune.sj.sys .us.xo.net...
I am using coverage.py to run my unit test suite to check for missing
tests. It mostly works, but for some mysterious reason, some of the
files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

Anyone have any ideas?
Where is coverage.py from? I used pycover at one point (found it
on the Vaults of Parnassus) and had to improve it for a number
of reasons.

John Roth Richard Wesley Trusted Media Networks, Inc.

Jul 18 '05 #2
Richard Wesley wrote:

I am using coverage.py to run my unit test suite to check for missing
tests. It mostly works, but for some mysterious reason, some of the
files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

Anyone have any ideas?


Yes, but probably not the right one. :-) Anyway, is it possible
that actually *none* of those files are being found, but instead
a bunch of leftover .pyc files in the current directory (or any
other directory that Python can find) are being found? .pyc files
are as good as .py files to Python, if it can't find the latter.

Also, are you aware of how sys.path is used? If you check each
directory, starting with the directory in which the main script
is found (and which shows up as '' in sys.path, usually at the start)
for the files, you should be able to find them. You can also
try importing one of the files that works, then do 'print module.__file__'
where module is replaced by the right name, and see where the
files that do work are actually coming from. It might not be
where you think it is.

Finally, try learning how to use "import pdb; pdb.set_trace()"
which starts an interactive debugger session in the context where
it executes. Putting this just ahead of the failing imports
would let you interactively debug the problem.

-Peter
Jul 18 '05 #3
> some of the files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

I believe there is a known issue with utilities that make use of .pyc
files (such as coverage tools) relating to the use of non-absolute
file paths.

The file path that gets stored as the "__file__" attribute is a
relative path, as a result, if an attempt is made to locate the source
file it will fail if the current directory is different to the current
directory when the .pyc file was created.

--Phil.
Jul 18 '05 #4
In article <vq************@news.supernews.com>,
"John Roth" <ne********@jhrothjr.com> wrote:
"Richard Wesley" <ha******@trustedmedianetworks.com> wrote in message
news:ha****************************@tribune.sj.sys .us.xo.net...
I am using coverage.py to run my unit test suite to check for missing
tests. It mostly works, but for some mysterious reason, some of the
files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

Anyone have any ideas?


Where is coverage.py from? I used pycover at one point (found it
on the Vaults of Parnassus) and had to improve it for a number
of reasons.


<http://www.garethrees.org/2001/12/04/python-coverage/>

Nice docs and such.

--

- rmgw

<http://www.trustedmedianetworks.com/>

----------------------------------------------------------------------------
Richard Wesley Trusted Media Networks, Inc.

"No, no no. 'Eureka' is Greek: It means 'This bath is too hot.'"
- The Doctor in "Dr. Who: The Talons of Weng-Chiang"
Jul 18 '05 #5

"Richard Wesley" <ha******@trustedmedianetworks.com> wrote in message
news:ha****************************@spectator.sj.s ys.us.xo.net...
In article <vq************@news.supernews.com>,
"John Roth" <ne********@jhrothjr.com> wrote:
"Richard Wesley" <ha******@trustedmedianetworks.com> wrote in message
news:ha****************************@tribune.sj.sys .us.xo.net...
I am using coverage.py to run my unit test suite to check for missing
tests. It mostly works, but for some mysterious reason, some of the
files can't be found because they are not in the same directory as
configure.py and unit_test.py. But only SOME of them.

Anyone have any ideas?
Where is coverage.py from? I used pycover at one point (found it
on the Vaults of Parnassus) and had to improve it for a number
of reasons.


<http://www.garethrees.org/2001/12/04/python-coverage/>

Nice docs and such.


Thanks. I'll look at it.

John Roth
--

- rmgw

<http://www.trustedmedianetworks.com/>

-------------------------------------------------------------------------- -- Richard Wesley Trusted Media Networks, Inc.
"No, no no. 'Eureka' is Greek: It means 'This bath is too hot.'"
- The Doctor in "Dr. Who: The Talons of Weng-Chiang"

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John J. Lee | last post by:
Anybody know of one? Actually, I have a feeling that emacs understands a standard format for errors, which would make it really easy to implement this by having the coverage tool print results...
1
by: Vijay Sankar | last post by:
Hi, I am using coverage.py to check the code coverage for some of my Python scripts. For a particular script which uses 'exit' calls, I am getting the following error when I invoke the script...
13
by: dave | last post by:
where is there a source which shows which css standard, and how much of that standard, is implemented in firefox's (1.0) engine? t.i.a.
6
by: tjm | last post by:
Pure coverage from Rational is the only coverage tool I've been able to find for C#, and I don't really want to pay what Rational charges for something as simple as a coverage tool. So, I'd like...
6
by: Stephanie Stowe | last post by:
I would love a tool which can be run when testing a classic ASP app which records what code has been executed. I have a problem I have to find occurances of through thousands of thousands of lines...
2
by: Orin | last post by:
Hi, I have a problem in using coverage.py module in my project: ../cov -c Traceback (most recent call last): File "./cov", line 10, in ? coverage.the_coverage.command_line(sys.argv) File...
0
by: Orin | last post by:
Thank you very much. Just reading the comments on that url, I found the reason of my problem. It was here: --- coverage.py +++ coverage.py @@ -464,6 +464,8 @@ def collect(self):...
1
by: Piotr Hrebieniuk | last post by:
Hi there. I've spent few hours and found nothing, so here's my question: How can i run tests wrote by myself on a module, using coverage.py ? Let's assume i have a module mymod.py which i want...
2
by: innes | last post by:
I can't find anything on this in the VS2008 help (searching for 'coverage' returns no results). Can anyone confirm that VS2008's code coverage functionality doesnt extend to working on C++/CLI...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.