From d222d78c7b6d00d0eb76a1f2f04274654e9194ee Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 5 Apr 2019 12:31:24 +0200 Subject: [PATCH] Zip imports don't have to work in Python2 --- conftest.py | 8 ++++++++ test/test_evaluate/test_imports.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 1b49c2b9..bfd19694 100644 --- a/conftest.py +++ b/conftest.py @@ -119,3 +119,11 @@ def has_typing(environment): @pytest.fixture(scope='session') def jedi_path(): return os.path.dirname(__file__) + + +@pytest.fixture() +def skip_python2(environment): + if environment.version_info.major == 2: + # This if is just needed to avoid that tests ever skip way more than + # they should for all Python versions. + pytest.skip() diff --git a/test/test_evaluate/test_imports.py b/test/test_evaluate/test_imports.py index c74b62fe..7e875e3a 100644 --- a/test/test_evaluate/test_imports.py +++ b/test/test_evaluate/test_imports.py @@ -82,7 +82,7 @@ def test_find_module_package_zipped(Script, evaluator, environment): ) def test_correct_zip_package_behavior(Script, evaluator, environment, code, - file, package, path): + file, package, path, skip_python2): sys_path = environment.get_sys_path() + [pkg_zip_path] pkg, = Script(code, sys_path=sys_path).goto_definitions() context, = pkg._name.infer()