-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 #3088 from abn/issue/3087
config: add support for installer.parallel
- Loading branch information
Showing
6 changed files
with
72 additions
and
10 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
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 |
---|---|---|
@@ -1,16 +1,29 @@ | ||
import os | ||
|
||
import pytest | ||
|
||
def test_config_get_default_value(config): | ||
assert config.get("virtualenvs.create") is True | ||
|
||
@pytest.mark.parametrize( | ||
("name", "value"), [("installer.parallel", True), ("virtualenvs.create", True)] | ||
) | ||
def test_config_get_default_value(config, name, value): | ||
assert config.get(name) is value | ||
|
||
|
||
def test_config_get_processes_depended_on_values(config): | ||
assert os.path.join("/foo", "virtualenvs") == config.get("virtualenvs.path") | ||
|
||
|
||
def test_config_get_from_environment_variable(config, environ): | ||
assert config.get("virtualenvs.create") | ||
|
||
os.environ["POETRY_VIRTUALENVS_CREATE"] = "false" | ||
assert not config.get("virtualenvs.create") | ||
@pytest.mark.parametrize( | ||
("name", "env_value", "value"), | ||
[ | ||
("installer.parallel", "true", True), | ||
("installer.parallel", "false", False), | ||
("virtualenvs.create", "true", True), | ||
("virtualenvs.create", "false", False), | ||
], | ||
) | ||
def test_config_get_from_environment_variable(config, environ, name, env_value, value): | ||
env_var = "POETRY_{}".format("_".join(k.upper() for k in name.split("."))) | ||
os.environ[env_var] = env_value | ||
assert config.get(name) is value |
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