Skip to content

Commit

Permalink
test: add a test for #1205 bpo-44840
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Aug 9, 2021
1 parent a8f4167 commit e6f37f6
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/test_arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ async def async_test():
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):
def test_bug1176(self):
self.check_coverage("""\
import asyncio
Expand All @@ -1910,6 +1910,32 @@ async def async_test():
)
assert self.stdout() == "12\n"

# https://github.com/nedbat/coveragepy/issues/1205
# https://bugs.python.org/issue44840
@pytest.mark.skipif(
(3, 10, 0, "alpha", 0, 0) <= env.PYVERSION[:6] <= (3, 10, 0, "candidate", 1, 0),
reason="avoid a 3.10 bug fixed after rc1: 44840"
)
def test_bug1205(self):
self.check_coverage("""\
def func():
if T(2):
if T(3):
if F(4):
if X(5):
return 6
else:
return 8
elif X(9) and Y:
return 10
T, F = (lambda _: True), (lambda _: False)
func()
""",
arcz=".1 1C CD D. .2 23 29 34 38 45 4. 56 5. 6. 8. 9. 9A A. -CC C-C",
arcz_missing="29 38 45 56 5. 6. 8. 9. 9A A.",
)


class AnnotationTest(CoverageTest):
"""Tests using type annotations."""
Expand Down

0 comments on commit e6f37f6

Please sign in to comment.