From 3b033bb276b6d81fd02265e62c11f4b7e4571925 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 7 May 2017 16:33:24 +0200 Subject: [PATCH] Remove two tests that are not necessary anymore because the code that made them necessary was removed (some import hacks). --- test/test_jedi_system.py | 61 ---------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 test/test_jedi_system.py diff --git a/test/test_jedi_system.py b/test/test_jedi_system.py deleted file mode 100644 index ea0d1e9d..00000000 --- a/test/test_jedi_system.py +++ /dev/null @@ -1,61 +0,0 @@ -""" -Test the Jedi "System" which means for example to test if imports are -correctly used. -""" - -import os -import inspect - -import jedi - - -def test_settings_module(): - """ - jedi.settings and jedi.cache.settings must be the same module. - """ - from jedi import cache - from jedi import settings - assert cache.settings is settings - - -def test_no_duplicate_modules(): - """ - Make sure that import hack works as expected. - - Jedi does an import hack (see: jedi/__init__.py) to have submodules - with circular dependencies. The modules in this circular dependency - "loop" must be imported by ``import `` rather than normal - ``from jedi import `` (or ``from . jedi ...``). This test - make sure that this is satisfied. - - See also: - - - `#160 `_ - - `#161 `_ - """ - import sys - jedipath = os.path.dirname(os.path.abspath(jedi.__file__)) - - def is_submodule(m): - try: - filepath = m.__file__ - except AttributeError: - return False - return os.path.abspath(filepath).startswith(jedipath) - - modules = list(filter(is_submodule, sys.modules.values())) - top_modules = [m for m in modules if not m.__name__.startswith('jedi.')] - for m in modules: - if m is jedi: - # py.test automatically improts `jedi.*` when --doctest-modules - # is given. So this test cannot succeeds. - continue - for tm in top_modules: - try: - imported = getattr(m, tm.__name__) - except AttributeError: - continue - if inspect.ismodule(imported): - # module could have a function with the same name, e.g. - # `keywords.keywords`. - assert imported is tm