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