mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-07 05:10:56 +08:00
Merge branch 'master' into typeshed
This commit is contained in:
@@ -154,6 +154,9 @@ def global_define():
|
||||
#? int()
|
||||
global_var_in_func
|
||||
|
||||
#? ['global_var_in_func']
|
||||
global_var_in_f
|
||||
|
||||
|
||||
def funct1():
|
||||
# From issue #610
|
||||
@@ -175,6 +178,7 @@ def init_global_var_predefined():
|
||||
#? int() None
|
||||
global_var_predefined
|
||||
|
||||
|
||||
# -----------------
|
||||
# within docstrs
|
||||
# -----------------
|
||||
|
||||
@@ -28,3 +28,7 @@ Fr'''sasdf''' + ''
|
||||
|
||||
#? ['upper']
|
||||
f'xyz'.uppe
|
||||
|
||||
|
||||
#? 3 []
|
||||
f'f'
|
||||
|
||||
@@ -7,7 +7,7 @@ import jedi
|
||||
from jedi._compatibility import py_version
|
||||
from jedi.api.environment import get_default_environment, find_virtualenvs, \
|
||||
InvalidPythonEnvironment, find_system_environments, \
|
||||
get_system_environment, create_environment
|
||||
get_system_environment, create_environment, get_cached_default_environment
|
||||
|
||||
|
||||
def test_sys_path():
|
||||
@@ -129,3 +129,10 @@ def test_get_default_environment_from_env_does_not_use_safe(tmpdir, monkeypatch)
|
||||
monkeypatch.setenv('VIRTUAL_ENV', fake_python)
|
||||
env = get_default_environment()
|
||||
assert env.path == 'fake'
|
||||
|
||||
|
||||
def test_changing_venv(venv_path, monkeypatch):
|
||||
monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', venv_path)
|
||||
get_cached_default_environment()
|
||||
monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', sys.executable)
|
||||
assert get_cached_default_environment().executable == sys.executable
|
||||
|
||||
Reference in New Issue
Block a user