diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-05-12 16:37:38 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-05-12 19:50:53 -0400 |
commit | 8abc5a12c773bba92c37c22480a8cf3db4ddbbec (patch) | |
tree | f2a054b6acff85b7b2dcd616fac04e94d456f8c8 | |
parent | 6c366390562940ead2c04226fbee2b36fdb05190 (diff) | |
download | python-coveragepy-git-8abc5a12c773bba92c37c22480a8cf3db4ddbbec.tar.gz |
test: adjust pybehave and tests for pypy 3.10
-rw-r--r-- | coverage/env.py | 7 | ||||
-rw-r--r-- | tests/test_arcs.py | 11 |
2 files changed, 13 insertions, 5 deletions
diff --git a/coverage/env.py b/coverage/env.py index 9f9b2553..3370970e 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -40,13 +40,10 @@ class PYBEHAVIOR: # Does Python conform to PEP626, Precise line numbers for debugging and other tools. # https://www.python.org/dev/peps/pep-0626 - pep626 = CPYTHON and (PYVERSION > (3, 10, 0, "alpha", 4)) + pep626 = (PYVERSION > (3, 10, 0, "alpha", 4)) # Is "if __debug__" optimized away? - if PYPY: - optimize_if_debug = True - else: - optimize_if_debug = not pep626 + optimize_if_debug = not pep626 # Is "if not __debug__" optimized away? The exact details have changed # across versions. diff --git a/tests/test_arcs.py b/tests/test_arcs.py index d4c1ba9d..6bb9ddf8 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -24,6 +24,10 @@ xfail_pypy_3882 = pytest.mark.xfail( reason="https://foss.heptapod.net/pypy/pypy/-/issues/3882", ) +xfail_pypy_3936 = pytest.mark.xfail( + env.PYPY and env.PYVERSION[:2] >= (3, 10), + reason="https://foss.heptapod.net/pypy/pypy/-/issues/3936", +) class SimpleArcTest(CoverageTest): """Tests for coverage.py's arc measurement.""" @@ -1325,6 +1329,7 @@ class YieldTest(CoverageTest): @pytest.mark.skipif(not env.PYBEHAVIOR.match_case, reason="Match-case is new in 3.10") class MatchCaseTest(CoverageTest): """Tests of match-case.""" + @xfail_pypy_3936 def test_match_case_with_default(self) -> None: self.check_coverage("""\ for command in ["huh", "go home", "go n"]: @@ -1341,6 +1346,7 @@ class MatchCaseTest(CoverageTest): ) assert self.stdout() == "default\nno go\ngo: n\n" + @xfail_pypy_3936 def test_match_case_with_wildcard(self) -> None: self.check_coverage("""\ for command in ["huh", "go home", "go n"]: @@ -1357,6 +1363,7 @@ class MatchCaseTest(CoverageTest): ) assert self.stdout() == "default: ['huh']\nno go\ngo: n\n" + @xfail_pypy_3936 def test_match_case_without_wildcard(self) -> None: self.check_coverage("""\ match = None @@ -1701,6 +1708,10 @@ class DecoratorArcTest(CoverageTest): ) @xfail_pypy38 + @pytest.mark.xfail( + env.PYPY and env.PYVERSION[:2] >= (3, 10), + reason="https://foss.heptapod.net/pypy/pypy/-/issues/3937", + ) def test_class_decorator(self) -> None: arcz = ( ".1 16 67 6D 7A AE E. " # main line |