Test to assure that imports are not loaded twice.

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

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))