Пример #1
0
def test_venv():
    with temp_chdir() as d:
        d = os.path.join(d, 'test_env')
        create_venv(d)
        global_python = get_python_path()

        with venv(d):
            venv_python = get_python_path()

        assert global_python != venv_python
        assert global_python == get_python_path()
Пример #2
0
def create_venv(d, pypath=None, verbose=False):
    command = ['virtualenv', d, '-p', pypath or get_python_path()]
    if not verbose:  # no cov
        command.append('--quiet')
    subprocess.run(command, shell=NEED_SUBPROCESS_SHELL)
Пример #3
0
def test_pypath():
    with temp_chdir() as d:
        d = os.path.join(d, 'test_env')
        create_venv(d, pypath=get_python_path())

        assert os.path.exists(d)