|
7 | 7 |
|
8 | 8 | import pytest
|
9 | 9 |
|
| 10 | +from deepdiff import DeepDiff |
10 | 11 | from poetry.core.pyproject.exceptions import PyProjectException
|
11 | 12 |
|
12 | 13 | from poetry.config.config_source import ConfigSource
|
13 | 14 | from poetry.factory import Factory
|
| 15 | +from tests.conftest import Config |
14 | 16 |
|
15 | 17 |
|
16 | 18 | if TYPE_CHECKING:
|
|
20 | 22 | from pytest_mock import MockerFixture
|
21 | 23 |
|
22 | 24 | from poetry.config.dict_config_source import DictConfigSource
|
23 |
| - from tests.conftest import Config |
24 | 25 | from tests.types import CommandTesterFactory
|
25 | 26 | from tests.types import FixtureDirGetter
|
26 | 27 |
|
@@ -53,6 +54,7 @@ def test_list_displays_default_value_if_not_set(
|
53 | 54 | experimental.new-installer = true
|
54 | 55 | experimental.system-git-client = false
|
55 | 56 | installer.max-workers = null
|
| 57 | +installer.no-binary = null |
56 | 58 | installer.parallel = true
|
57 | 59 | virtualenvs.create = true
|
58 | 60 | virtualenvs.in-project = null
|
@@ -80,6 +82,7 @@ def test_list_displays_set_get_setting(
|
80 | 82 | experimental.new-installer = true
|
81 | 83 | experimental.system-git-client = false
|
82 | 84 | installer.max-workers = null
|
| 85 | +installer.no-binary = null |
83 | 86 | installer.parallel = true
|
84 | 87 | virtualenvs.create = false
|
85 | 88 | virtualenvs.in-project = null
|
@@ -131,6 +134,7 @@ def test_list_displays_set_get_local_setting(
|
131 | 134 | experimental.new-installer = true
|
132 | 135 | experimental.system-git-client = false
|
133 | 136 | installer.max-workers = null
|
| 137 | +installer.no-binary = null |
134 | 138 | installer.parallel = true
|
135 | 139 | virtualenvs.create = false
|
136 | 140 | virtualenvs.in-project = null
|
@@ -200,3 +204,33 @@ def test_config_installer_parallel(
|
200 | 204 | "install"
|
201 | 205 | )._command._installer._executor._max_workers
|
202 | 206 | assert workers == 1
|
| 207 | + |
| 208 | + |
| 209 | +@pytest.mark.parametrize( |
| 210 | + ("value", "expected"), |
| 211 | + [ |
| 212 | + ("true", [":all:"]), |
| 213 | + ("1", [":all:"]), |
| 214 | + ("false", [":none:"]), |
| 215 | + ("0", [":none:"]), |
| 216 | + ("pytest", ["pytest"]), |
| 217 | + ("PyTest", ["pytest"]), |
| 218 | + ("pytest,black", ["pytest", "black"]), |
| 219 | + ("", []), |
| 220 | + ], |
| 221 | +) |
| 222 | +def test_config_installer_no_binary( |
| 223 | + tester: CommandTester, value: str, expected: list[str] |
| 224 | +) -> None: |
| 225 | + setting = "installer.no-binary" |
| 226 | + |
| 227 | + tester.execute(setting) |
| 228 | + assert tester.io.fetch_output().strip() == "null" |
| 229 | + |
| 230 | + config = Config.create() |
| 231 | + assert not config.get(setting) |
| 232 | + |
| 233 | + tester.execute(f"{setting} '{value}'") |
| 234 | + |
| 235 | + config = Config.create(reload=True) |
| 236 | + assert not DeepDiff(config.get(setting), expected, ignore_order=True) |
0 commit comments