Skip to content

Commit 8abc5a1

Browse files
committedMay 12, 2023
test: adjust pybehave and tests for pypy 3.10
1 parent 6c36639 commit 8abc5a1

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed
 

‎coverage/env.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@ class PYBEHAVIOR:
4040

4141
# Does Python conform to PEP626, Precise line numbers for debugging and other tools.
4242
# https://www.python.org/dev/peps/pep-0626
43-
pep626 = CPYTHON and (PYVERSION > (3, 10, 0, "alpha", 4))
43+
pep626 = (PYVERSION > (3, 10, 0, "alpha", 4))
4444

4545
# Is "if __debug__" optimized away?
46-
if PYPY:
47-
optimize_if_debug = True
48-
else:
49-
optimize_if_debug = not pep626
46+
optimize_if_debug = not pep626
5047

5148
# Is "if not __debug__" optimized away? The exact details have changed
5249
# across versions.

‎tests/test_arcs.py

+11
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
reason="https://foss.heptapod.net/pypy/pypy/-/issues/3882",
2525
)
2626

27+
xfail_pypy_3936 = pytest.mark.xfail(
28+
env.PYPY and env.PYVERSION[:2] >= (3, 10),
29+
reason="https://foss.heptapod.net/pypy/pypy/-/issues/3936",
30+
)
2731

2832
class SimpleArcTest(CoverageTest):
2933
"""Tests for coverage.py's arc measurement."""
@@ -1325,6 +1329,7 @@ def gen():
13251329
@pytest.mark.skipif(not env.PYBEHAVIOR.match_case, reason="Match-case is new in 3.10")
13261330
class MatchCaseTest(CoverageTest):
13271331
"""Tests of match-case."""
1332+
@xfail_pypy_3936
13281333
def test_match_case_with_default(self) -> None:
13291334
self.check_coverage("""\
13301335
for command in ["huh", "go home", "go n"]:
@@ -1341,6 +1346,7 @@ def test_match_case_with_default(self) -> None:
13411346
)
13421347
assert self.stdout() == "default\nno go\ngo: n\n"
13431348

1349+
@xfail_pypy_3936
13441350
def test_match_case_with_wildcard(self) -> None:
13451351
self.check_coverage("""\
13461352
for command in ["huh", "go home", "go n"]:
@@ -1357,6 +1363,7 @@ def test_match_case_with_wildcard(self) -> None:
13571363
)
13581364
assert self.stdout() == "default: ['huh']\nno go\ngo: n\n"
13591365

1366+
@xfail_pypy_3936
13601367
def test_match_case_without_wildcard(self) -> None:
13611368
self.check_coverage("""\
13621369
match = None
@@ -1701,6 +1708,10 @@ def my_function(
17011708
)
17021709

17031710
@xfail_pypy38
1711+
@pytest.mark.xfail(
1712+
env.PYPY and env.PYVERSION[:2] >= (3, 10),
1713+
reason="https://foss.heptapod.net/pypy/pypy/-/issues/3937",
1714+
)
17041715
def test_class_decorator(self) -> None:
17051716
arcz = (
17061717
".1 16 67 6D 7A AE E. " # main line

0 commit comments

Comments
 (0)
Please sign in to comment.