From e2c97e9675db9bb870111c79f8ed67b86560715f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 6 Aug 2017 18:04:31 +0200 Subject: [PATCH] Skip tests in PyPy that don't make sense to test. --- parso/_compatibility.py | 3 +++ test/test_python_errors.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/parso/_compatibility.py b/parso/_compatibility.py index d9432ca..9ddf23d 100644 --- a/parso/_compatibility.py +++ b/parso/_compatibility.py @@ -3,6 +3,7 @@ To ensure compatibility from Python ``2.6`` - ``3.3``, a module has been created. Clearly there is huge need to use conforming syntax. """ import sys +import platform # Cannot use sys.version.major and minor names, because in Python 2.6 it's not # a namedtuple. @@ -14,6 +15,8 @@ try: except NameError: unicode = str +is_pypy = platform.python_implementation() == 'PyPy' + def use_metaclass(meta, *bases): """ Create a class with a metaclass. """ diff --git a/test/test_python_errors.py b/test/test_python_errors.py index 026b639..b9dfea7 100644 --- a/test/test_python_errors.py +++ b/test/test_python_errors.py @@ -7,9 +7,15 @@ import warnings import pytest import parso +from parso._compatibility import is_pypy from .failing_examples import FAILING_EXAMPLES, indent, build_nested +if is_pypy: + # The errors in PyPy might be different. Just skip the module for now. + pytestmark = pytest.mark.skip() + + def _get_error_list(code, version=None): grammar = parso.load_grammar(version=version) tree = grammar.parse(code)