summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-27 06:57:18 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-12-27 07:20:49 -0500
commit5af6270dd72f2a217823a32bf7141d3f7c1a2a92 (patch)
treeedf3c7dc2a3f71ca31a8269b387e7f08ebdf49b9 /tests
parent769ea88198e15d4c549ed57b41abc6b996be68c1 (diff)
downloadpython-coveragepy-git-5af6270dd72f2a217823a32bf7141d3f7c1a2a92.tar.gz
fix: adjust some PyPy behaviors. #1515
Diffstat (limited to 'tests')
-rw-r--r--tests/helpers.py7
-rw-r--r--tests/test_arcs.py8
-rw-r--r--tests/test_coverage.py4
-rw-r--r--tests/test_parser.py7
4 files changed, 8 insertions, 18 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index fbdf1397..725bd340 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -317,8 +317,7 @@ def swallow_warnings(message=r".", category=CoverageWarning):
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",
+xfail_pypy38 = pytest.mark.xfail(
+ env.PYVERSION[:2] == (3, 8) and env.PYPY,
+ reason="Not sure why these few tests fail on PyPy 3.8 still",
)
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index df7d0001..eee30923 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, xfail_pypy_3749
+from tests.helpers import assert_count_equal, xfail_pypy38
import coverage
from coverage import env
@@ -1645,7 +1645,6 @@ 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
@@ -1674,7 +1673,7 @@ class DecoratorArcTest(CoverageTest):
arcz=arcz,
)
- @xfail_pypy_3749
+ @xfail_pypy38
def test_class_decorator(self):
arcz = (
".1 16 67 6D 7A AE E. " # main line
@@ -1702,7 +1701,6 @@ 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...!
@@ -1727,7 +1725,6 @@ 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,7 +1916,6 @@ 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 b9e5d6ae..17da4f5e 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -10,7 +10,6 @@ from coverage import env
from coverage.exceptions import NoDataError
from tests.coveragetest import CoverageTest
-from tests.helpers import xfail_pypy_3749
class TestCoverageTest(CoverageTest):
@@ -1618,7 +1617,6 @@ 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:
@@ -1639,7 +1637,6 @@ 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:
@@ -1660,7 +1657,6 @@ 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 b13c32fe..057b9244 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -15,7 +15,7 @@ from coverage.exceptions import NotPython
from coverage.parser import ast_dump, PythonParser
from tests.coveragetest import CoverageTest, TESTS_DIR
-from tests.helpers import arcz_to_arcs, re_lines, xfail_pypy_3749
+from tests.helpers import arcz_to_arcs, re_lines, xfail_pypy38
class PythonParserTest(CoverageTest):
@@ -140,7 +140,7 @@ class PythonParserTest(CoverageTest):
'''
""")
- @xfail_pypy_3749
+ @xfail_pypy38
def test_decorator_pragmas(self):
parser = self.parse_source("""\
# 1
@@ -176,7 +176,7 @@ class PythonParserTest(CoverageTest):
assert parser.raw_statements == raw_statements
assert parser.statements == {8}
- @xfail_pypy_3749
+ @xfail_pypy38
def test_decorator_pragmas_with_colons(self):
# A colon in a decorator expression would confuse the parser,
# ending the exclusion of the decorated function.
@@ -211,7 +211,6 @@ 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):