Skip to content

Commit

Permalink
test: skip tests that fail until CPython #92236 is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 12, 2022
1 parent 956f0fd commit e5b91eb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_arcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
from coverage.files import abs_file


skip_cpython_92236 = pytest.mark.skipif(
env.PYVERSION >= (3, 11, 0, "beta"),
reason="Avoid a CPython bug: https:/python/cpython/issues/92236",
# #92236 is fixed in https:/python/cpython/pull/92722
)

class SimpleArcTest(CoverageTest):
"""Tests for coverage.py's arc measurement."""

Expand Down Expand Up @@ -605,6 +611,7 @@ def wrong_loop(x):
arcz_missing="26 3. 6.",
)

@skip_cpython_92236
def test_generator_expression(self):
# Generator expression:
self.check_coverage("""\
Expand All @@ -617,6 +624,7 @@ def test_generator_expression(self):
arcz=".1 -22 2-2 12 23 34 45 53 3.",
)

@skip_cpython_92236
def test_generator_expression_another_way(self):
# https://bugs.python.org/issue44450
# Generator expression:
Expand Down Expand Up @@ -1169,6 +1177,7 @@ def func(x):
class YieldTest(CoverageTest):
"""Arc tests for generators."""

@skip_cpython_92236
def test_yield_in_loop(self):
self.check_coverage("""\
def gen(inp):
Expand All @@ -1180,6 +1189,7 @@ def gen(inp):
arcz=".1 .2 23 2. 32 15 5.",
)

@skip_cpython_92236
def test_padded_yield_in_loop(self):
self.check_coverage("""\
def gen(inp):
Expand All @@ -1200,6 +1210,7 @@ def gen(inp):
env.PYVERSION[:5] == (3, 11, 0, 'alpha', 3),
reason="avoid 3.11 bug: bpo46225",
)
@skip_cpython_92236
def test_bug_308(self):
self.check_coverage("""\
def run():
Expand Down Expand Up @@ -1234,6 +1245,7 @@ def run():
arcz=".1 14 45 54 4. .2 2. -22 2-2",
)

@skip_cpython_92236
def test_bug_324(self):
# This code is tricky: the list() call pulls all the values from gen(),
# but each of them is a generator itself that is never iterated. As a
Expand All @@ -1252,6 +1264,7 @@ def gen(inp):
arcz_missing="-33 3-3",
)

@skip_cpython_92236
def test_coroutines(self):
self.check_coverage("""\
def double_inputs():
Expand All @@ -1271,6 +1284,7 @@ def double_inputs():
)
assert self.stdout() == "20\n12\n"

@skip_cpython_92236
def test_yield_from(self):
self.check_coverage("""\
def gen(inp):
Expand All @@ -1286,6 +1300,7 @@ def gen(inp):
arcz=".1 19 9. .2 23 34 45 56 63 37 7.",
)

@skip_cpython_92236
def test_abandoned_yield(self):
# https:/nedbat/coveragepy/issues/440
self.check_coverage("""\
Expand Down Expand Up @@ -1614,6 +1629,7 @@ def test_pathologically_long_code_object(self, n):
self.check_coverage(code, arcs=[(-1, 1), (1, 2*n+4), (2*n+4, -1)])
assert self.stdout() == f"{n}\n"

@skip_cpython_92236
def test_partial_generators(self):
# https:/nedbat/coveragepy/issues/475
# Line 2 is executed completely.
Expand Down Expand Up @@ -1830,6 +1846,7 @@ class AsyncTest(CoverageTest):
"""Tests of the new async and await keywords in Python 3.5"""

@xfail_eventlet_670
@skip_cpython_92236
def test_async(self):
self.check_coverage("""\
import asyncio
Expand Down Expand Up @@ -1857,6 +1874,7 @@ async def print_sum(x, y): # 8
assert self.stdout() == "Compute 1 + 2 ...\n1 + 2 = 3\n"

@xfail_eventlet_670
@skip_cpython_92236
def test_async_for(self):
self.check_coverage("""\
import asyncio
Expand Down Expand Up @@ -1932,6 +1950,7 @@ async def go():
# https://bugs.python.org/issue44621
@pytest.mark.skipif(env.PYVERSION[:2] == (3, 9), reason="avoid a 3.9 bug: 44621")
@pytest.mark.skipif(env.PYVERSION < (3, 7), reason="need asyncio.run")
@skip_cpython_92236
def test_bug_1158(self):
self.check_coverage("""\
import asyncio
Expand Down Expand Up @@ -1962,6 +1981,7 @@ async def async_test():
)
@xfail_eventlet_670
@pytest.mark.skipif(env.PYVERSION < (3, 7), reason="need asyncio.run")
@skip_cpython_92236
def test_bug_1176(self):
self.check_coverage("""\
import asyncio
Expand Down

0 comments on commit e5b91eb

Please sign in to comment.