diff options
-rw-r--r-- | coverage/env.py | 13 | ||||
-rw-r--r-- | tests/test_parser.py | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/coverage/env.py b/coverage/env.py index 1c09caf1..175b3092 100644 --- a/coverage/env.py +++ b/coverage/env.py @@ -11,19 +11,22 @@ import sys WINDOWS = sys.platform == "win32" LINUX = sys.platform.startswith("linux") +# Python versions. +PYVERSION = sys.version_info +PY2 = PYVERSION < (3, 0) +PY3 = PYVERSION >= (3, 0) + # Python implementations. PYPY = (platform.python_implementation() == 'PyPy') if PYPY: PYPYVERSION = sys.pypy_version_info +PYPY2 = PYPY and PY2 +PYPY3 = PYPY and PY3 + JYTHON = (platform.python_implementation() == 'Jython') IRONPYTHON = (platform.python_implementation() == 'IronPython') -# Python versions. -PYVERSION = sys.version_info -PY2 = PYVERSION < (3, 0) -PY3 = PYVERSION >= (3, 0) - # Python behavior class PYBEHAVIOR(object): """Flags indicating this Python's behavior.""" diff --git a/tests/test_parser.py b/tests/test_parser.py index 053e4fd8..8e7295a1 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -138,6 +138,8 @@ class PythonParserTest(CoverageTest): """) def test_decorator_pragmas(self): + if env.PYPY3 and env.PYPYVERSION >= (7, 3, 0): # pragma: obscure + self.xfail("https://bitbucket.org/pypy/pypy/issues/3139") parser = self.parse_source("""\ # 1 @@ -168,7 +170,7 @@ class PythonParserTest(CoverageTest): """) raw_statements = set([3, 4, 5, 6, 8, 9, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) if env.PYBEHAVIOR.trace_decorated_def: - raw_statements.update([11, 19, 25]) + raw_statements.update([11, 19]) self.assertEqual(parser.raw_statements, raw_statements) self.assertEqual(parser.statements, set([8])) |