Skip to content

Commit e6a8102

Browse files
committed
test: skip tests on py 3.11.0a4 that are failing in metacov
This specific set of circumstances was triggering https://bugs.python.org/issue44088
1 parent 6e02043 commit e6a8102

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

coverage/sqldata.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ def add_arcs(self, arc_data):
497497
self._set_context_id()
498498
for filename, arcs in arc_data.items():
499499
file_id = self._file_id(filename, add=True)
500+
from coverage import env
501+
if env.PYVERSION == (3, 11, 0, "alpha", 4, 0):
502+
arcs = [(a, b) for a, b in arcs if a is not None and b is not None]
500503
data = [(file_id, self._current_context_id, fromno, tono) for fromno, tono in arcs]
501504
con.executemany(
502505
"insert or ignore into arc " +

tests/test_arcs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ def run():
12341234
arcz=".1 14 45 54 4. .2 2. -22 2-2",
12351235
)
12361236

1237-
@pytest.mark.xfail(
1237+
@pytest.mark.skipif(
12381238
((3, 11, 0, "alpha", 4, 0) == env.PYVERSION) and not env.C_TRACER,
12391239
reason="avoid a 3.11 bug: https://bugs.python.org/issue46389",
12401240
)
@@ -1623,7 +1623,7 @@ def test_pathologically_long_code_object(self, n):
16231623
self.check_coverage(code, arcs=[(-1, 1), (1, 2*n+4), (2*n+4, -1)])
16241624
assert self.stdout() == f"{n}\n"
16251625

1626-
@pytest.mark.xfail(
1626+
@pytest.mark.skipif(
16271627
((3, 11, 0, "alpha", 4, 0) == env.PYVERSION) and not env.C_TRACER,
16281628
reason="avoid a 3.11 bug: https://bugs.python.org/issue46389",
16291629
)

tests/test_concurrency.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,11 @@ def try_multiprocessing_code(
496496
last_line = self.squeezed_lines(out)[-1]
497497
assert re.search(r"TOTAL \d+ 0 100%", last_line)
498498

499+
@pytest.mark.skipif(
500+
((3, 11, 0, "alpha", 4, 0) == env.PYVERSION),
501+
#((3, 11, 0, "alpha", 4, 0) == env.PYVERSION) and not env.C_TRACER and env.METACOV,
502+
reason="avoid a 3.11 bug: https://bugs.python.org/issue46389",
503+
)
499504
def test_multiprocessing_simple(self, start_method):
500505
nprocs = 3
501506
upto = 30
@@ -510,6 +515,11 @@ def test_multiprocessing_simple(self, start_method):
510515
start_method=start_method,
511516
)
512517

518+
@pytest.mark.skipif(
519+
((3, 11, 0, "alpha", 4, 0) == env.PYVERSION),
520+
#((3, 11, 0, "alpha", 4, 0) == env.PYVERSION) and not env.C_TRACER and env.METACOV,
521+
reason="avoid a 3.11 bug: https://bugs.python.org/issue46389",
522+
)
513523
def test_multiprocessing_append(self, start_method):
514524
nprocs = 3
515525
upto = 30

0 commit comments

Comments
 (0)