Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Mar 3, 2020
1 parent e4be2ef commit 763bbe7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/unit/create/test_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from virtualenv.create.creator import DEBUG_SCRIPT, Creator, get_env_debug_info
from virtualenv.discovery.builtin import get_interpreter
from virtualenv.discovery.py_info import PythonInfo
from virtualenv.info import IS_PYPY, PY3, fs_supports_symlink
from virtualenv.info import IS_PYPY, PY3, fs_is_case_sensitive, fs_supports_symlink
from virtualenv.pyenv_cfg import PyEnvCfg
from virtualenv.run import cli_run, session_via_cli
from virtualenv.util.path import Path
Expand Down Expand Up @@ -395,14 +395,14 @@ def test_create_distutils_cfg(creator, tmp_path, monkeypatch):
def test_python_path(monkeypatch, tmp_path, python_path_on):
result = cli_run([ensure_text(str(tmp_path)), "--without-pip", "--activators", ""])
monkeypatch.chdir(tmp_path)
case_sensitive = fs_is_case_sensitive()

def _get_sys_path(flag=None):
cmd = [str(result.creator.exe)]
if flag:
cmd.append(flag)
cmd.extend(["-c", "import json; import sys; print(json.dumps(sys.path))"])
print(cmd)
return json.loads(subprocess.check_output(cmd))
return [i if case_sensitive else i.lower() for i in json.loads(subprocess.check_output(cmd))]

monkeypatch.delenv(str("PYTHONPATH"), raising=False)
base = _get_sys_path()
Expand Down Expand Up @@ -435,6 +435,7 @@ def _get_sys_path(flag=None):

assert not (set(base) - set(extra_all)) # all base paths are present
abs_python_paths = list(OrderedDict((os.path.abspath(ensure_text(i)), None) for i in python_paths).keys())
abs_python_paths = [i if case_sensitive else i.lower() for i in abs_python_paths]

extra_as_python_path = extra_all[: len(abs_python_paths)]
assert abs_python_paths == extra_as_python_path # python paths are there at the start
Expand Down

0 comments on commit 763bbe7

Please sign in to comment.