Пример #1
0
def test_PYTHONPATH_not_present_in_testing_env_if_set():
    with env.set_env('PYTHONPATH', 'fred'):
        with mock.patch.object(venv.Workspace, 'run') as run:
            venv.VirtualEnv()
            call = run.mock_calls[0]
            assert 'PYTHONPATH' not in call[2]['env']

            venv.VirtualEnv({'PYTHONPATH': 'john'})
            call = run.mock_calls[1]
            assert 'PYTHONPATH' not in call[2]['env']
Пример #2
0
def bare_virtualenv():
    """ Bare virtualenv (no pip/setuptools/wheel).
    """
    with pytest_virtualenv.VirtualEnv(args=(
            '--no-wheel',
            '--no-pip',
            '--no-setuptools',
    )) as venv:
        yield venv
Пример #3
0
def test_installed_packages():
    with venv.VirtualEnv() as v:
        ips = v.installed_packages()
        assert len(ips) > 0
        check_member('pip', ips)
        check_member('virtualenv', ips)