diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-31 18:39:49 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-01-31 18:39:49 -0500 |
commit | ce17b1a6811e4cacbb7de5c876003347b0a91e65 (patch) | |
tree | f509b5575c1826674b19f226ce9812a58d9edf34 /tests | |
parent | 703f088e67c256b2491ced099b994f277775fe5f (diff) | |
download | python-coveragepy-git-ce17b1a6811e4cacbb7de5c876003347b0a91e65.tar.gz |
Yield statements that are not resumed shouldn't be marked as missing. #440
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_arcs.py | 16 | ||||
-rw-r--r-- | tests/test_data.py | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py index 030b719d..60cef938 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -981,6 +981,22 @@ class YieldTest(CoverageTest): arcz_unpredicted="5.", ) + def test_abandoned_yield(self): + # https://bitbucket.org/ned/coveragepy/issue/440 + self.check_coverage("""\ + def gen(): + print("yup") + yield "yielded" + print("nope") + + print(next(gen())) + """, + lines=[1, 2, 3, 4, 6], + missing="4", + arcz=".1 16 6. .2 23 34 4.", + arcz_missing="34 4.", + ) + class MiscArcTest(CoverageTest): """Miscellaneous arc-measuring tests.""" diff --git a/tests/test_data.py b/tests/test_data.py index b3882726..52702e97 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -66,7 +66,7 @@ ARCS_4 = { (1000, -1): None, }, } -SUMMARY_3_4 = {'x.py': 5, 'y.py': 2, 'z.py': 1} +SUMMARY_3_4 = {'x.py': 4, 'y.py': 2, 'z.py': 1} MEASURED_FILES_3_4 = ['x.py', 'y.py', 'z.py'] |