mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Fix interpeter project path
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user