summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-08-09 06:29:31 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-08-09 06:29:31 -0400
commite6f37f6ff184b4e9d2dad75386ddeb03bf492fd4 (patch)
tree6cc0cf343ba1d7af6274246413ed9e0a65ad9606
parenta8f416738ce88046f17381a7161fbfc4219678bc (diff)
downloadpython-coveragepy-git-e6f37f6ff184b4e9d2dad75386ddeb03bf492fd4.tar.gz
test: add a test for #1205 bpo-44840
-rw-r--r--tests/test_arcs.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index ffdc469d..b2d75377 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1893,7 +1893,7 @@ class AsyncTest(CoverageTest):
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
@@ -1910,6 +1910,32 @@ class AsyncTest(CoverageTest):
)
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."""