13
13
from coverage .files import abs_file
14
14
15
15
16
+ skip_cpython_92236 = pytest .mark .skipif (
17
+ env .PYVERSION >= (3 , 11 , 0 , "beta" ),
18
+ reason = "Avoid a CPython bug: https://github.com/python/cpython/issues/92236" ,
19
+ )
20
+
16
21
class SimpleArcTest (CoverageTest ):
17
22
"""Tests for coverage.py's arc measurement."""
18
23
@@ -605,6 +610,7 @@ def wrong_loop(x):
605
610
arcz_missing = "26 3. 6." ,
606
611
)
607
612
613
+ @skip_cpython_92236
608
614
def test_generator_expression (self ):
609
615
# Generator expression:
610
616
self .check_coverage ("""\
@@ -617,6 +623,7 @@ def test_generator_expression(self):
617
623
arcz = ".1 -22 2-2 12 23 34 45 53 3." ,
618
624
)
619
625
626
+ @skip_cpython_92236
620
627
def test_generator_expression_another_way (self ):
621
628
# https://bugs.python.org/issue44450
622
629
# Generator expression:
@@ -1169,6 +1176,7 @@ def func(x):
1169
1176
class YieldTest (CoverageTest ):
1170
1177
"""Arc tests for generators."""
1171
1178
1179
+ @skip_cpython_92236
1172
1180
def test_yield_in_loop (self ):
1173
1181
self .check_coverage ("""\
1174
1182
def gen(inp):
@@ -1180,6 +1188,7 @@ def gen(inp):
1180
1188
arcz = ".1 .2 23 2. 32 15 5." ,
1181
1189
)
1182
1190
1191
+ @skip_cpython_92236
1183
1192
def test_padded_yield_in_loop (self ):
1184
1193
self .check_coverage ("""\
1185
1194
def gen(inp):
@@ -1200,6 +1209,7 @@ def gen(inp):
1200
1209
env .PYVERSION [:5 ] == (3 , 11 , 0 , 'alpha' , 3 ),
1201
1210
reason = "avoid 3.11 bug: bpo46225" ,
1202
1211
)
1212
+ @skip_cpython_92236
1203
1213
def test_bug_308 (self ):
1204
1214
self .check_coverage ("""\
1205
1215
def run():
@@ -1234,6 +1244,7 @@ def run():
1234
1244
arcz = ".1 14 45 54 4. .2 2. -22 2-2" ,
1235
1245
)
1236
1246
1247
+ @skip_cpython_92236
1237
1248
def test_bug_324 (self ):
1238
1249
# This code is tricky: the list() call pulls all the values from gen(),
1239
1250
# but each of them is a generator itself that is never iterated. As a
@@ -1252,6 +1263,7 @@ def gen(inp):
1252
1263
arcz_missing = "-33 3-3" ,
1253
1264
)
1254
1265
1266
+ @skip_cpython_92236
1255
1267
def test_coroutines (self ):
1256
1268
self .check_coverage ("""\
1257
1269
def double_inputs():
@@ -1271,6 +1283,7 @@ def double_inputs():
1271
1283
)
1272
1284
assert self .stdout () == "20\n 12\n "
1273
1285
1286
+ @skip_cpython_92236
1274
1287
def test_yield_from (self ):
1275
1288
self .check_coverage ("""\
1276
1289
def gen(inp):
@@ -1286,6 +1299,7 @@ def gen(inp):
1286
1299
arcz = ".1 19 9. .2 23 34 45 56 63 37 7." ,
1287
1300
)
1288
1301
1302
+ @skip_cpython_92236
1289
1303
def test_abandoned_yield (self ):
1290
1304
# https://github.com/nedbat/coveragepy/issues/440
1291
1305
self .check_coverage ("""\
@@ -1614,6 +1628,7 @@ def test_pathologically_long_code_object(self, n):
1614
1628
self .check_coverage (code , arcs = [(- 1 , 1 ), (1 , 2 * n + 4 ), (2 * n + 4 , - 1 )])
1615
1629
assert self .stdout () == f"{ n } \n "
1616
1630
1631
+ @skip_cpython_92236
1617
1632
def test_partial_generators (self ):
1618
1633
# https://github.com/nedbat/coveragepy/issues/475
1619
1634
# Line 2 is executed completely.
@@ -1830,6 +1845,7 @@ class AsyncTest(CoverageTest):
1830
1845
"""Tests of the new async and await keywords in Python 3.5"""
1831
1846
1832
1847
@xfail_eventlet_670
1848
+ @skip_cpython_92236
1833
1849
def test_async (self ):
1834
1850
self .check_coverage ("""\
1835
1851
import asyncio
@@ -1857,6 +1873,7 @@ async def print_sum(x, y): # 8
1857
1873
assert self .stdout () == "Compute 1 + 2 ...\n 1 + 2 = 3\n "
1858
1874
1859
1875
@xfail_eventlet_670
1876
+ @skip_cpython_92236
1860
1877
def test_async_for (self ):
1861
1878
self .check_coverage ("""\
1862
1879
import asyncio
@@ -1932,6 +1949,7 @@ async def go():
1932
1949
# https://bugs.python.org/issue44621
1933
1950
@pytest .mark .skipif (env .PYVERSION [:2 ] == (3 , 9 ), reason = "avoid a 3.9 bug: 44621" )
1934
1951
@pytest .mark .skipif (env .PYVERSION < (3 , 7 ), reason = "need asyncio.run" )
1952
+ @skip_cpython_92236
1935
1953
def test_bug_1158 (self ):
1936
1954
self .check_coverage ("""\
1937
1955
import asyncio
@@ -1962,6 +1980,7 @@ async def async_test():
1962
1980
)
1963
1981
@xfail_eventlet_670
1964
1982
@pytest .mark .skipif (env .PYVERSION < (3 , 7 ), reason = "need asyncio.run" )
1983
+ @skip_cpython_92236
1965
1984
def test_bug_1176 (self ):
1966
1985
self .check_coverage ("""\
1967
1986
import asyncio
0 commit comments