diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-07-19 19:10:13 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-07-19 19:10:13 -0400 |
commit | 48f884c33a75ef35b759be6b8d6afdf7645e3517 (patch) | |
tree | a651190e41d470f0e74e203a70330a8a11c6ed24 /tests/test_arcs.py | |
parent | 9288ef767b461153c297f98e8d2989b796c41bba (diff) | |
download | python-coveragepy-git-48f884c33a75ef35b759be6b8d6afdf7645e3517.tar.gz |
test: add a test for bpo 44622, #1176
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r-- | tests/test_arcs.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py index ed6c16e4..a21074bf 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -1886,6 +1886,30 @@ class AsyncTest(CoverageTest): ) assert self.stdout() == "14\n" + # https://github.com/nedbat/coveragepy/issues/1176 + # https://bugs.python.org/issue44622 + @pytest.mark.skipif( + (3, 10, 0, "alpha", 0, 0) <= env.PYVERSION[:6] <= (3, 10, 0, "beta", 4, 0), + reason="avoid a 3.10 bug fixed after beta 4: 44622" + ) + @pytest.mark.skipif(env.PYVERSION < (3, 7), reason="need asyncio.run") + def test_bug1176_a(self): + self.check_coverage("""\ + import asyncio + + async def async_gen(): + yield 4 + + async def async_test(): + async for i in async_gen(): + print(i + 8) + + asyncio.run(async_test()) + """, + arcz=".1 13 36 6A A. -34 4-3 -67 78 87 7-6", + ) + assert self.stdout() == "12\n" + class AnnotationTest(CoverageTest): """Tests using type annotations.""" |