diff --git a/tests/__main__.py b/tests/__main__.py index 4762773..901f101 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -10,7 +10,7 @@ from .test_reconstructor import TestReconstructor try: from .test_nearley.test_nearley import TestNearley except ImportError: - pass + logging.warn("Warning: Skipping tests for Nearley (js2py required)") # from .test_selectors import TestSelectors # from .test_grammars import TestPythonG, TestConfigG diff --git a/tests/test_nearley/test_nearley.py b/tests/test_nearley/test_nearley.py index 721db1d..647f489 100644 --- a/tests/test_nearley/test_nearley.py +++ b/tests/test_nearley/test_nearley.py @@ -15,9 +15,12 @@ NEARLEY_PATH = os.path.join(TEST_PATH, 'nearley') BUILTIN_PATH = os.path.join(NEARLEY_PATH, 'builtin') if not os.path.exists(NEARLEY_PATH): - print("Skipping Nearley tests!") + logging.warn("Nearley not installed. Skipping Nearley tests!") raise ImportError("Skipping Nearley tests!") +import js2py # Ensures that js2py exists, to avoid failing tests + + class TestNearley(unittest.TestCase): def test_css(self): fn = os.path.join(NEARLEY_PATH, 'examples/csscolor.ne')