Skip to content

Commit 48f884c

Browse files
committed
test: add a test for bpo 44622, #1176
1 parent 9288ef7 commit 48f884c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_arcs.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,30 @@ async def async_test():
18861886
)
18871887
assert self.stdout() == "14\n"
18881888

1889+
# https://github.com/nedbat/coveragepy/issues/1176
1890+
# https://bugs.python.org/issue44622
1891+
@pytest.mark.skipif(
1892+
(3, 10, 0, "alpha", 0, 0) <= env.PYVERSION[:6] <= (3, 10, 0, "beta", 4, 0),
1893+
reason="avoid a 3.10 bug fixed after beta 4: 44622"
1894+
)
1895+
@pytest.mark.skipif(env.PYVERSION < (3, 7), reason="need asyncio.run")
1896+
def test_bug1176_a(self):
1897+
self.check_coverage("""\
1898+
import asyncio
1899+
1900+
async def async_gen():
1901+
yield 4
1902+
1903+
async def async_test():
1904+
async for i in async_gen():
1905+
print(i + 8)
1906+
1907+
asyncio.run(async_test())
1908+
""",
1909+
arcz=".1 13 36 6A A. -34 4-3 -67 78 87 7-6",
1910+
)
1911+
assert self.stdout() == "12\n"
1912+
18891913

18901914
class AnnotationTest(CoverageTest):
18911915
"""Tests using type annotations."""

0 commit comments

Comments
 (0)