Test to assure that imports are not loaded twice.

This commit is contained in:
Dave Halter committed 2015-10-10 19:49:40 +02:00
1 parent 99e819f91a
commit f77712ddf1
2 files changed
+15 -7

No files matched your search

+7
View File
@@ -57,3 +57,10 @@ def test_flask_ext(script, name):
def test_not_importable_file():
src = 'import not_importable_file as x; x.'
assert not jedi.Script(src, path='example.py').completions()
def test_import_unique():
src = "import os; os.path"
defs = jedi.Script(src, path='example.py').goto_definitions()
defs = [d._definition for d in defs]
assert len(defs) == len(set(defs))