diff options
-rw-r--r-- | tests/helpers.py | 9 | ||||
-rw-r--r-- | tests/test_arcs.py | 7 | ||||
-rw-r--r-- | tests/test_coverage.py | 4 | ||||
-rw-r--r-- | tests/test_parser.py | 9 |
4 files changed, 23 insertions, 6 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 16194aed..32115dc1 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -15,6 +15,9 @@ import warnings from unittest import mock +import pytest + +from coverage import env from coverage.exceptions import CoverageWarning from coverage.misc import output_encoding @@ -313,3 +316,9 @@ def swallow_warnings(message=r".", category=CoverageWarning): with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=category, message=message) yield + + +xfail_pypy_3749 = pytest.mark.xfail( + env.PYVERSION[:2] == (3, 8) and env.PYPY and env.PYPYVERSION >= (7, 3, 10), + reason="Avoid a PyPy bug: https://foss.heptapod.net/pypy/pypy/-/issues/3749" +) diff --git a/tests/test_arcs.py b/tests/test_arcs.py index f094cc90..d0e840af 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -6,7 +6,7 @@ import pytest from tests.coveragetest import CoverageTest -from tests.helpers import assert_count_equal +from tests.helpers import assert_count_equal, xfail_pypy_3749 import coverage from coverage import env @@ -1647,6 +1647,7 @@ class MiscArcTest(CoverageTest): class DecoratorArcTest(CoverageTest): """Tests of arcs with decorators.""" + @xfail_pypy_3749 def test_function_decorator(self): arcz = ( ".1 16 67 7A AE EF F. " # main line @@ -1675,6 +1676,7 @@ class DecoratorArcTest(CoverageTest): arcz=arcz, ) + @xfail_pypy_3749 def test_class_decorator(self): arcz = ( ".1 16 67 6D 7A AE E. " # main line @@ -1702,6 +1704,7 @@ class DecoratorArcTest(CoverageTest): arcz=arcz, ) + @xfail_pypy_3749 def test_bug_466a(self): # A bad interaction between decorators and multi-line list assignments, # believe it or not...! @@ -1726,6 +1729,7 @@ class DecoratorArcTest(CoverageTest): arcz=arcz, ) + @xfail_pypy_3749 def test_bug_466b(self): # A bad interaction between decorators and multi-line list assignments, # believe it or not...! @@ -1919,6 +1923,7 @@ class AsyncTest(CoverageTest): arcz_missing=arcz_missing, ) + @xfail_pypy_3749 def test_async_decorator(self): arcz = ".1 14 4. .2 2. -46 6-4 " if env.PYBEHAVIOR.trace_decorated_def: diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 17da4f5e..b9e5d6ae 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -10,6 +10,7 @@ from coverage import env from coverage.exceptions import NoDataError from tests.coveragetest import CoverageTest +from tests.helpers import xfail_pypy_3749 class TestCoverageTest(CoverageTest): @@ -1617,6 +1618,7 @@ class ExcludeTest(CoverageTest): class Py24Test(CoverageTest): """Tests of new syntax in Python 2.4.""" + @xfail_pypy_3749 def test_function_decorators(self): lines = [1, 2, 3, 4, 6, 8, 10, 12] if env.PYBEHAVIOR.trace_decorated_def: @@ -1637,6 +1639,7 @@ class Py24Test(CoverageTest): """, lines, "") + @xfail_pypy_3749 def test_function_decorators_with_args(self): lines = [1, 2, 3, 4, 5, 6, 8, 10, 12] if env.PYBEHAVIOR.trace_decorated_def: @@ -1657,6 +1660,7 @@ class Py24Test(CoverageTest): """, lines, "") + @xfail_pypy_3749 def test_double_function_decorators(self): lines = [1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 17, 19, 21, 22, 24, 26] if env.PYBEHAVIOR.trace_decorated_def: diff --git a/tests/test_parser.py b/tests/test_parser.py index cc5d6ba0..a20741ad 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -14,7 +14,7 @@ from coverage.exceptions import NotPython from coverage.parser import ast_dump, ast_parse, PythonParser from tests.coveragetest import CoverageTest, TESTS_DIR -from tests.helpers import arcz_to_arcs, re_lines +from tests.helpers import arcz_to_arcs, re_lines, xfail_pypy_3749 class PythonParserTest(CoverageTest): @@ -139,10 +139,7 @@ class PythonParserTest(CoverageTest): ''' """) - @pytest.mark.xfail( - env.PYPY and env.PYPYVERSION == (7, 3, 0), - reason="https://bitbucket.org/pypy/pypy/issues/3139", - ) + @xfail_pypy_3749 def test_decorator_pragmas(self): parser = self.parse_source("""\ # 1 @@ -178,6 +175,7 @@ class PythonParserTest(CoverageTest): assert parser.raw_statements == raw_statements assert parser.statements == {8} + @xfail_pypy_3749 def test_decorator_pragmas_with_colons(self): # A colon in a decorator expression would confuse the parser, # ending the exclusion of the decorated function. @@ -212,6 +210,7 @@ class PythonParserTest(CoverageTest): assert parser.raw_statements == {1, 2, 3, 5, 6, 7, 8} assert parser.statements == {1, 2, 3} + @xfail_pypy_3749 def test_empty_decorated_function(self): parser = self.parse_source("""\ def decorator(func): |