A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/nedbat/coveragepy/issues/290 below:

Running programmatically with .pyw files · Issue #290 · nedbat/coveragepy · GitHub

Originally reported by Okko Willeboordse (Bitbucket: owillebo, GitHub: owillebo)

I have two files;

test.py;

#!python
import coverage
cov = coverage.coverage(source = ['target'])
cov.start()
import target
cov.stop()
print cov.html_report()

and target.py(w);

When I run test.py with target.py it outputs, as expected;
50.0
But when I rename target.py in to target.pyw, test.py outputs;

#!python

Coverage.py warning: Module target has no Python source.
Coverage.py warning: No data was collected.
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    print cov.html_report()
  File "c:\Python27\lib\site-packages\coverage\control.py", line 662, in html_report
    return reporter.report(morfs)
  File "c:\Python27\lib\site-packages\coverage\html.py", line 113, in report
    self.report_files(self.html_file, morfs, self.config.html_dir)
  File "c:\Python27\lib\site-packages\coverage\report.py", line 76, in report_files
    raise CoverageException("No data to report.")
coverage.misc.CoverageException: No data to report.

How do I run coverage programmatically with .pyw files?

Note that Python imports both target.py and with .pyw just the same.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4