diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-11-18 10:40:07 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-11-18 10:40:07 -0500 |
commit | 55ab51bdae6e578f544926da777246ca0ab369e3 (patch) | |
tree | a73ee82feb022ced31ea35493d89445ea9736e53 /tests/test_summary.py | |
parent | 2eedae529974aa0eb0aff7bd411b3b9cd2e9e8aa (diff) | |
download | python-coveragepy-git-55ab51bdae6e578f544926da777246ca0ab369e3.tar.gz |
Convert farm/run/run_xxx.py to a test_summary.py test
Diffstat (limited to 'tests/test_summary.py')
-rw-r--r-- | tests/test_summary.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_summary.py b/tests/test_summary.py index 51bedb6d..f0e8956e 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -564,6 +564,22 @@ class SummaryTest(UsingModulesMixin, CoverageTest): self.assertEqual(self.line_count(report), 3) self.assertIn('No data to report.', report) + def test_report_no_extension(self): + self.make_file("xxx", """\ + # This is a python file though it doesn't look like it, like a main script. + a = b = c = d = 0 + a = 3 + b = 4 + if not b: + c = 6 + d = 7 + print("xxx: %r %r %r %r" % (a, b, c, d)) + """) + out = self.run_command("coverage run xxx") + self.assertEqual(out, "xxx: 3 4 0 7\n") + report = self.report_from_command("coverage report") + self.assertEqual(self.last_line_squeezed(report), "xxx 7 1 86%") + def get_report(self, cov): """Get the report from `cov`, and canonicalize it.""" repout = StringIO() |