Fix interpeter project path

This commit is contained in:
Dave Halter
2019-08-05 00:43:37 +02:00
parent 38e0cbc1d2
commit 45dada9552
4 changed files with 16 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
import os
from ..helpers import get_example_dir
from ..helpers import get_example_dir, set_cwd, root_dir
from jedi import Interpreter
def test_django_default_project(Script):
@@ -13,3 +14,11 @@ def test_django_default_project(Script):
c, = script.completions()
assert c.name == "SomeModel"
assert script._evaluator.project._django is True
def test_interpreter_project_path():
# Run from anywhere it should be the cwd.
dir = os.path.join(root_dir, 'test')
with set_cwd(dir):
project = Interpreter('', [locals()])._evaluator.project
assert project._path == dir