Running programmatically with .pyw files

Issue #290 resolved
Okko Willeboordse created an issue

I have two files;;

import coverage
cov = coverage.coverage(source = ['target'])
import target
print cov.html_report()


def foo():

When I run with it outputs, as expected; 50.0 But when I rename in to target.pyw, outputs; warning: Module target has no Python source. warning: No data was collected.
Traceback (most recent call last):
  File "", line 6, in <module>
    print cov.html_report()
  File "c:\Python27\lib\site-packages\coverage\", line 662, in html_report
  File "c:\Python27\lib\site-packages\coverage\", line 113, in report
    self.report_files(self.html_file, morfs, self.config.html_dir)
  File "c:\Python27\lib\site-packages\coverage\", 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 and with .pyw just the same.

Comments (1)

  1. Log in to comment