Please run attached zip archive as a python script. Note that the problem is not specific for using __main__.py - any module that comes from a zip archive or loaded by a custom loader would show the same bug.
$ unzip -l test.zip
Archive: test.zip
Length Date Time Name
-------- ---- ---- ----
79 10-24-08 18:26 __main__.py
-------- -------
79 1 file
$ $ cat __main__.py
from trace import Trace
def traced(flag):
if flag:
return 1
else:
return 2
tracer = Trace()
tracer.runfunc(traced, False)
results = tracer.results()
results.write_results(coverdir='.')
$ python testtrace.zip
--- modulename: __main__, funcname: traced
Not printing coverage data for 'testtrace.zip/__main__.py': [Errno 20] Not a directory: 'testtrace.zip/__main__.py'
__main__.py(4): __main__.py(7): $ |