summaryrefslogtreecommitdiff
path: root/tests/test_summary.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-09 17:42:53 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-09 19:00:40 -0500
commit880a64afd24aae34eff2781f568d8ac9807d2ecc (patch)
tree802cf3368d4d7a1b27ee6b5d614c367ac691e320 /tests/test_summary.py
parent8fef6f057c377879720c4c9d994e9651362a49b9 (diff)
downloadpython-coveragepy-git-880a64afd24aae34eff2781f568d8ac9807d2ecc.tar.gz
fix: isolate user code from coverage.py internal code flags. #1524
Diffstat (limited to 'tests/test_summary.py')
-rw-r--r--tests/test_summary.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_summary.py b/tests/test_summary.py
index 3109e90f..f532a7b1 100644
--- a/tests/test_summary.py
+++ b/tests/test_summary.py
@@ -849,6 +849,22 @@ class SummaryTest(UsingModulesMixin, CoverageTest):
assert self.get_report(cov, output_format="total", precision=2) == "78.57\n"
assert self.get_report(cov, output_format="total", precision=4) == "78.5714\n"
+ def test_bug_1524(self) -> None:
+ self.make_file("bug1524.py", """\
+ class Mine:
+ @property
+ def thing(self) -> int:
+ return 17
+
+ print(Mine().thing)
+ """)
+ cov = coverage.Coverage()
+ self.start_import_stop(cov, "bug1524")
+ assert self.stdout() == "17\n"
+ report = self.get_report(cov)
+ report_lines = report.splitlines()
+ assert report_lines[2] == "bug1524.py 5 0 100%"
+
class ReportingReturnValueTest(CoverageTest):
"""Tests of reporting functions returning values."""