-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from kevinconway/provisional_venv_support
Add provisional stdlib venv support
- Loading branch information
Showing
6 changed files
with
126 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Test fixtures and configuration.""" | ||
|
||
from __future__ import division | ||
from __future__ import absolute_import | ||
from __future__ import print_function | ||
from __future__ import unicode_literals | ||
|
||
import uuid | ||
|
||
import pytest | ||
|
||
from venvctrl import api | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
if "use_stdlib_venv" in metafunc.fixturenames: | ||
metafunc.parametrize("use_stdlib_venv", (True, False)) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def random(): | ||
"""Get a random UUID.""" | ||
return str(uuid.uuid4()) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def venv(random, tmpdir, use_stdlib_venv): | ||
"""Get an initialized venv.""" | ||
path = str(tmpdir.join(random)) | ||
v = api.VirtualEnvironment(path) | ||
if not use_stdlib_venv: | ||
v.create() | ||
else: | ||
v._execute("python -m venv {0}".format(path)) | ||
return v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters