Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,3 +611,38 @@ for more information.
Enable the system keyring for storing credentials.
See [Repositories - Configuring credentials]({{< relref "repositories#configuring-credentials" >}})
for more information.

### `default-group-optionality`

**Type**: `boolean`

**Default**: `false`

**Environment Variable**: `POETRY_DEFAULT_GROUP_OPTIONALITY`

*Introduced in 2.3.0*

When set to `true`, all dependency groups (except the implicit `main` group) are treated as optional by default.
This means that `poetry install` will only install the main dependencies unless groups are explicitly requested
with `--with` or `--only` options.

This setting allows developers to omit the `optional = true` declaration from `pyproject.toml` for most
dependency groups, reducing configuration verbosity when working with projects that have many optional groups.

{{% note %}}
This is a user-specific configuration and does not affect the `pyproject.toml` file or how dependencies
are resolved. It only changes which groups are installed by default.
{{% /note %}}

**Example usage:**

```bash
# Enable default-group-optionality
poetry config default-group-optionality true

# Now only main dependencies are installed by default
poetry install

# Explicitly include specific groups
poetry install --with test,docs
```
2 changes: 2 additions & 0 deletions src/poetry/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class Config:
"keyring": {
"enabled": True,
},
"default-group-optionality": False,
}

def __init__(self, use_environment: bool = True) -> None:
Expand Down Expand Up @@ -389,6 +390,7 @@ def _get_normalizer(name: str) -> Callable[[str], Any]:
"solver.lazy-wheel",
"system-git-client",
"keyring.enabled",
"default-group-optionality",
}:
return boolean_normalizer

Expand Down
1 change: 1 addition & 0 deletions src/poetry/console/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def unique_config_values(self) -> dict[str, tuple[Any, Any]]:
"solver.lazy-wheel": (boolean_validator, boolean_normalizer),
"keyring.enabled": (boolean_validator, boolean_normalizer),
"python.installation-dir": (str, lambda val: str(Path(val))),
"default-group-optionality": (boolean_validator, boolean_normalizer),
}

return unique_config_values
Expand Down
4 changes: 4 additions & 0 deletions src/poetry/console/commands/group_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def _group_dependency_options() -> list[Option]:
@property
def non_optional_groups(self) -> set[str]:
# TODO: this should move into poetry-core
default_optional = self.poetry.config.get("default-group-optionality", False)
if default_optional:
Comment on lines 48 to +50
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Use named expression to simplify assignment and conditional (use-named-expression)

Suggested change
# TODO: this should move into poetry-core
default_optional = self.poetry.config.get("default-group-optionality", False)
if default_optional:
if default_optional := self.poetry.config.get(
"default-group-optionality", False
):

# When default-group-optionality is True, all groups are optional
return set()
return {
group.name
for group in self.poetry.package._dependency_groups.values()
Expand Down
1 change: 1 addition & 0 deletions tests/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def get_options_based_on_normalizer(normalizer: Normalizer) -> Iterator[str]:
("installer.parallel", True),
("virtualenvs.create", True),
("requests.max-retries", 0),
("default-group-optionality", False),
],
)
def test_config_get_default_value(config: Config, name: str, value: bool) -> None:
Expand Down
2 changes: 2 additions & 0 deletions tests/console/commands/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
data-dir = {data_dir}
default-group-optionality = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
Expand Down Expand Up @@ -101,6 +102,7 @@
venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
expected = f"""cache-dir = {cache_dir}
data-dir = {data_dir}
default-group-optionality = false
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
Expand Down Expand Up @@ -177,7 +179,7 @@
virtualenvs.use-poetry-python = false
"""
assert config.set_config_source.call_count == 0 # type: ignore[attr-defined]
assert tester.io.fetch_output() == expected

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 182 in tests/console/commands/test_config.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_config.py#L182

tests.console.commands.test_config.test_unset_setting
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x3bae38be0150>
config = <tests.conftest.Config object at 0x3bae38c58490>
config_cache_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry')
config_data_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry')

    def test_unset_setting(
        tester: CommandTester, config: Config, config_cache_dir: Path, config_data_dir: Path
    ) -> None:
        tester.execute("virtualenvs.path /some/path")
        tester.execute("virtualenvs.path --unset")
        tester.execute("--list")
        cache_dir = json.dumps(str(config_cache_dir))
        data_dir = json.dumps(str(config_data_dir))
        venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
        expected = f"""cache-dir = {cache_dir}
    data-dir = {data_dir}
    installer.max-workers = null
    installer.no-binary = null
    installer.only-binary = null
    installer.parallel = true
    installer.re-resolve = true
    keyring.enabled = true
    python.installation-dir = {json.dumps(str(Path("{data-dir}/python")))}  # {config_data_dir / "python"}
    requests.max-retries = 0
    solver.lazy-wheel = true
    system-git-client = false
    virtualenvs.create = true
    virtualenvs.in-project = null
    virtualenvs.options.always-copy = false
    virtualenvs.options.no-pip = false
    virtualenvs.options.system-site-packages = false
    virtualenvs.path = {venv_path}  # {config_cache_dir / "virtualenvs"}
    virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
    virtualenvs.use-poetry-python = false
    """
        assert config.set_config_source.call_count == 0  # type: ignore[attr-defined]
>       assert tester.io.fetch_output() == expected
E       assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n'
E         
E           cache-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry"
E           data-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry"
E         + default-group-optionality = false
E           installer.max-workers = null
E           installer.no-binary = null
E           installer.only-binary = null
E           installer.parallel = true
E           installer.re-resolve = true
E           keyring.enabled = true
E           python.installation-dir = "{data-dir}/python"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.local/share/pypoetry/python
E           requests.max-retries = 0
E           solver.lazy-wheel = true
E           system-git-client = false
E           virtualenvs.create = true
E           virtualenvs.in-project = null
E           virtualenvs.options.always-copy = false
E           virtualenvs.options.no-pip = false
E           virtualenvs.options.system-site-packages = false
E           virtualenvs.path = "{cache-dir}/virtualenvs"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_setting0/.cache/pypoetry/virtualenvs
E           virtualenvs.prompt = "{project_name}-py{python_version}"
E           virtualenvs.use-poetry-python = false

/tmp/cirrus-ci-build/tests/console/commands/test_config.py:182: AssertionError

Check failure on line 182 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_unset_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false


def test_unset_repo_setting(
Expand Down Expand Up @@ -211,7 +213,7 @@
virtualenvs.use-poetry-python = false
"""
assert config.set_config_source.call_count == 0 # type: ignore[attr-defined]
assert tester.io.fetch_output() == expected

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 216 in tests/console/commands/test_config.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_config.py#L216

tests.console.commands.test_config.test_unset_repo_setting
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x3bae3e147110>
config = <tests.conftest.Config object at 0x3bae3e016050>
config_cache_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.cache/pypoetry')
config_data_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.local/share/pypoetry')

    def test_unset_repo_setting(
        tester: CommandTester, config: Config, config_cache_dir: Path, config_data_dir: Path
    ) -> None:
        tester.execute("repositories.foo.url https://bar.com/simple/")
        tester.execute("repositories.foo.url --unset ")
        tester.execute("--list")
        cache_dir = json.dumps(str(config_cache_dir))
        data_dir = json.dumps(str(config_data_dir))
        venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
        expected = f"""cache-dir = {cache_dir}
    data-dir = {data_dir}
    installer.max-workers = null
    installer.no-binary = null
    installer.only-binary = null
    installer.parallel = true
    installer.re-resolve = true
    keyring.enabled = true
    python.installation-dir = {json.dumps(str(Path("{data-dir}/python")))}  # {config_data_dir / "python"}
    requests.max-retries = 0
    solver.lazy-wheel = true
    system-git-client = false
    virtualenvs.create = true
    virtualenvs.in-project = null
    virtualenvs.options.always-copy = false
    virtualenvs.options.no-pip = false
    virtualenvs.options.system-site-packages = false
    virtualenvs.path = {venv_path}  # {config_cache_dir / "virtualenvs"}
    virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
    virtualenvs.use-poetry-python = false
    """
        assert config.set_config_source.call_count == 0  # type: ignore[attr-defined]
>       assert tester.io.fetch_output() == expected
E       assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n'
E         
E           cache-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.cache/pypoetry"
E           data-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.local/share/pypoetry"
E         + default-group-optionality = false
E           installer.max-workers = null
E           installer.no-binary = null
E           installer.only-binary = null
E           installer.parallel = true
E           installer.re-resolve = true
E           keyring.enabled = true
E           python.installation-dir = "{data-dir}/python"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.local/share/pypoetry/python
E           requests.max-retries = 0
E           solver.lazy-wheel = true
E           system-git-client = false
E           virtualenvs.create = true
E           virtualenvs.in-project = null
E           virtualenvs.options.always-copy = false
E           virtualenvs.options.no-pip = false
E           virtualenvs.options.system-site-packages = false
E           virtualenvs.path = "{cache-dir}/virtualenvs"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_unset_repo_setting0/.cache/pypoetry/virtualenvs
E           virtualenvs.prompt = "{project_name}-py{python_version}"
E           virtualenvs.use-poetry-python = false

/tmp/cirrus-ci-build/tests/console/commands/test_config.py:216: AssertionError

Check failure on line 216 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_unset_repo_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_unset_repo_setting0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false


def test_unset_value_not_exists(tester: CommandTester) -> None:
Expand Down Expand Up @@ -347,7 +349,7 @@
"""

assert config.set_config_source.call_count == 1 # type: ignore[attr-defined]
assert tester.io.fetch_output() == expected

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 352 in tests/console/commands/test_config.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_config.py#L352

tests.console.commands.test_config.test_list_displays_set_get_local_setting
Raw output
tester = <cleo.testers.command_tester.CommandTester object at 0x3bae39a2c6d0>
config = <tests.conftest.Config object at 0x3bae3ba5eb10>
config_cache_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.cache/pypoetry')
config_data_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.local/share/pypoetry')

    def test_list_displays_set_get_local_setting(
        tester: CommandTester,
        config: Config,
        config_cache_dir: Path,
        config_data_dir: Path,
    ) -> None:
        tester.execute("virtualenvs.create false --local")
    
        tester.execute("--list")
    
        cache_dir = json.dumps(str(config_cache_dir))
        data_dir = json.dumps(str(config_data_dir))
        venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
        expected = f"""cache-dir = {cache_dir}
    data-dir = {data_dir}
    installer.max-workers = null
    installer.no-binary = null
    installer.only-binary = null
    installer.parallel = true
    installer.re-resolve = true
    keyring.enabled = true
    python.installation-dir = {json.dumps(str(Path("{data-dir}/python")))}  # {config_data_dir / "python"}
    requests.max-retries = 0
    solver.lazy-wheel = true
    system-git-client = false
    virtualenvs.create = false
    virtualenvs.in-project = null
    virtualenvs.options.always-copy = false
    virtualenvs.options.no-pip = false
    virtualenvs.options.system-site-packages = false
    virtualenvs.path = {venv_path}  # {config_cache_dir / "virtualenvs"}
    virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
    virtualenvs.use-poetry-python = false
    """
    
        assert config.set_config_source.call_count == 1  # type: ignore[attr-defined]
>       assert tester.io.fetch_output() == expected
E       assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n'
E         
E           cache-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.cache/pypoetry"
E           data-dir = "/tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.local/share/pypoetry"
E         + default-group-optionality = false
E           installer.max-workers = null
E           installer.no-binary = null
E           installer.only-binary = null
E           installer.parallel = true
E           installer.re-resolve = true
E           keyring.enabled = true
E           python.installation-dir = "{data-dir}/python"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.local/share/pypoetry/python
E           requests.max-retries = 0
E           solver.lazy-wheel = true
E           system-git-client = false
E           virtualenvs.create = false
E           virtualenvs.in-project = null
E           virtualenvs.options.always-copy = false
E           virtualenvs.options.no-pip = false
E           virtualenvs.options.system-site-packages = false
E           virtualenvs.path = "{cache-dir}/virtualenvs"  # /tmp/pytest-of-root/pytest-0/popen-gw0/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs
E           virtualenvs.prompt = "{project_name}-py{python_version}"
E           virtualenvs.use-poetry-python = false

/tmp/cirrus-ci-build/tests/console/commands/test_config.py:352: AssertionError

Check failure on line 352 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_list_displays_set_get_local_setting assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.local/share/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = false virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_displays_set_get_loc0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false


def test_list_must_not_display_sources_from_pyproject_toml(
Expand Down Expand Up @@ -390,7 +392,7 @@
virtualenvs.use-poetry-python = false
"""

assert tester.io.fetch_output() == expected

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw3/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw2/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /tmp/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw0/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false

Check failure on line 395 in tests/console/commands/test_config.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_config.py#L395

tests.console.commands.test_config.test_list_must_not_display_sources_from_pyproject_toml
Raw output
project_factory = <function project_factory.<locals>._factory at 0x307f125bd300>
fixture_dir = <function fixture_dir.<locals>._fixture_dir at 0x307f0e56c680>
command_tester_factory = <function command_tester_factory.<locals>._tester at 0x307f12616840>
config_cache_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry')
config_data_dir = PosixPath('/tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry')

    def test_list_must_not_display_sources_from_pyproject_toml(
        project_factory: ProjectFactory,
        fixture_dir: FixtureDirGetter,
        command_tester_factory: CommandTesterFactory,
        config_cache_dir: Path,
        config_data_dir: Path,
    ) -> None:
        source = fixture_dir("with_primary_source_implicit")
        pyproject_content = (source / "pyproject.toml").read_text(encoding="utf-8")
        poetry = project_factory("foo", pyproject_content=pyproject_content)
        tester = command_tester_factory("config", poetry=poetry)
    
        tester.execute("--list")
    
        cache_dir = json.dumps(str(config_cache_dir))
        data_dir = json.dumps(str(config_data_dir))
        venv_path = json.dumps(os.path.join("{cache-dir}", "virtualenvs"))
        expected = f"""cache-dir = {cache_dir}
    data-dir = {data_dir}
    installer.max-workers = null
    installer.no-binary = null
    installer.only-binary = null
    installer.parallel = true
    installer.re-resolve = true
    keyring.enabled = true
    python.installation-dir = {json.dumps(str(Path("{data-dir}/python")))}  # {config_data_dir / "python"}
    repositories.foo.url = "https://foo.bar/simple/"
    requests.max-retries = 0
    solver.lazy-wheel = true
    system-git-client = false
    virtualenvs.create = true
    virtualenvs.in-project = null
    virtualenvs.options.always-copy = false
    virtualenvs.options.no-pip = false
    virtualenvs.options.system-site-packages = false
    virtualenvs.path = {venv_path}  # {config_cache_dir / "virtualenvs"}
    virtualenvs.prompt = "{{project_name}}-py{{python_version}}"
    virtualenvs.use-poetry-python = false
    """
    
>       assert tester.io.fetch_output() == expected
E       assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n'
E         
E           cache-dir = "/tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry"
E           data-dir = "/tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry"
E         + default-group-optionality = false
E           installer.max-workers = null
E           installer.no-binary = null
E           installer.only-binary = null
E           installer.parallel = true
E           installer.re-resolve = true
E           keyring.enabled = true
E           python.installation-dir = "{data-dir}/python"  # /tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python
E           repositories.foo.url = "https://foo.bar/simple/"
E           requests.max-retries = 0
E           solver.lazy-wheel = true
E           system-git-client = false
E           virtualenvs.create = true
E           virtualenvs.in-project = null
E           virtualenvs.options.always-copy = false
E           virtualenvs.options.no-pip = false
E           virtualenvs.options.system-site-packages = false
E           virtualenvs.path = "{cache-dir}/virtualenvs"  # /tmp/pytest-of-root/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs
E           virtualenvs.prompt = "{project_name}-py{python_version}"
E           virtualenvs.use-poetry-python = false

/tmp/cirrus-ci-build/tests/console/commands/test_config.py:395: AssertionError

Check failure on line 395 in tests/console/commands/test_config.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_list_must_not_display_sources_from_pyproject_toml assert 'cache-dir = ...hon = false\n' == 'cache-dir = ...hon = false\n' cache-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry" data-dir = "/private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry" + default-group-optionality = false installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.local/share/pypoetry/python repositories.foo.url = "https://foo.bar/simple/" requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = null virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /private/var/folders/8s/1jkm89h96qjdtjr7q3bll2vh0000gn/T/pytest-of-runner/pytest-0/popen-gw1/test_list_must_not_display_sou0/.cache/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false


def test_set_http_basic(
Expand Down
217 changes: 217 additions & 0 deletions tests/console/commands/test_default_group_optionality.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
from __future__ import annotations

from typing import TYPE_CHECKING

import pytest

from poetry.core.packages.dependency_group import MAIN_GROUP


if TYPE_CHECKING:
from cleo.testers.command_tester import CommandTester
from pytest_mock import MockerFixture

from poetry.poetry import Poetry
from tests.types import CommandTesterFactory
from tests.types import ProjectFactory


PYPROJECT_CONTENT = """\
[tool.poetry]
name = "test-project"
version = "1.0.0"
description = "Test project"
authors = ["Test Author <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.8"
requests = "^2.0.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.0.0"

[tool.poetry.group.dev.dependencies]
black = "^23.0.0"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^5.0.0"
"""


@pytest.fixture
def poetry(project_factory: ProjectFactory) -> Poetry:
return project_factory(
name="test-default-group-optionality", pyproject_content=PYPROJECT_CONTENT
)


@pytest.fixture
def install_tester(
command_tester_factory: CommandTesterFactory, poetry: Poetry
) -> CommandTester:
return command_tester_factory("install")


@pytest.fixture
def config_tester(
command_tester_factory: CommandTesterFactory, poetry: Poetry
) -> CommandTester:
return command_tester_factory("config")


def test_default_behavior_without_config(
install_tester: CommandTester, mocker: MockerFixture
) -> None:
"""
By default, without the config set, all non-optional groups are installed.
"""
mocker.patch.object(install_tester.command.installer, "run", return_value=0)
mocker.patch(
"poetry.masonry.builders.editable.EditableBuilder",
side_effect=Exception("Should not be called"),
)

status_code = install_tester.execute("--no-root")
assert status_code == 0

# By default, main, test, and dev should be installed (not docs as it's optional)
installer_groups = set(install_tester.command.installer._groups or [])
assert installer_groups == {MAIN_GROUP, "test", "dev"}


def test_with_default_group_optionality_enabled(
config_tester: CommandTester,
install_tester: CommandTester,
mocker: MockerFixture,
) -> None:
"""
With default-group-optionality enabled, only main group is installed by default.
"""
# Enable the configuration
config_tester.execute("--local default-group-optionality true")
assert config_tester.status_code == 0

# Reload config
install_tester.command.poetry.config.merge({"default-group-optionality": True})

mocker.patch.object(install_tester.command.installer, "run", return_value=0)
mocker.patch(
"poetry.masonry.builders.editable.EditableBuilder",
side_effect=Exception("Should not be called"),
)

status_code = install_tester.execute("--no-root")
assert status_code == 0

# With default-group-optionality, only main group should be installed
installer_groups = set(install_tester.command.installer._groups or [])
assert installer_groups == {MAIN_GROUP}

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_default_group_optionality.py#L111

tests.console.commands.test_default_group_optionality.test_with_default_group_optionality_enabled
Raw output
config_tester = <cleo.testers.command_tester.CommandTester object at 0x307f1053f790>
install_tester = <cleo.testers.command_tester.CommandTester object at 0x307f12233390>
mocker = <pytest_mock.plugin.MockerFixture object at 0x307f10582f50>

    def test_with_default_group_optionality_enabled(
        config_tester: CommandTester,
        install_tester: CommandTester,
        mocker: MockerFixture,
    ) -> None:
        """
        With default-group-optionality enabled, only main group is installed by default.
        """
        # Enable the configuration
        config_tester.execute("--local default-group-optionality true")
        assert config_tester.status_code == 0
    
        # Reload config
        install_tester.command.poetry.config.merge({"default-group-optionality": True})
    
        mocker.patch.object(install_tester.command.installer, "run", return_value=0)
        mocker.patch(
            "poetry.masonry.builders.editable.EditableBuilder",
            side_effect=Exception("Should not be called"),
        )
    
        status_code = install_tester.execute("--no-root")
        assert status_code == 0
    
        # With default-group-optionality, only main group should be installed
        installer_groups = set(install_tester.command.installer._groups or [])
>       assert installer_groups == {MAIN_GROUP}
E       AssertionError: assert set() == {'main'}
E         
E         Extra items in the right set:
E         'main'
E         
E         Full diff:
E         + set()
E         - {
E         -     'main',
E         - }

/tmp/cirrus-ci-build/tests/console/commands/test_default_group_optionality.py:111: AssertionError

Check failure on line 111 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_with_default_group_optionality_enabled AssertionError: assert set() == {'main'} Extra items in the right set: 'main' Full diff: + set() - { - 'main', - }


def test_with_default_group_optionality_and_with_option(
install_tester: CommandTester, mocker: MockerFixture
) -> None:
"""
With default-group-optionality enabled, --with can explicitly include groups.
"""
# Enable the configuration
install_tester.command.poetry.config.merge({"default-group-optionality": True})

mocker.patch.object(install_tester.command.installer, "run", return_value=0)
mocker.patch(
"poetry.masonry.builders.editable.EditableBuilder",
side_effect=Exception("Should not be called"),
)

status_code = install_tester.execute("--no-root --with test,dev")
assert status_code == 0

# Should install main, test, and dev groups
installer_groups = set(install_tester.command.installer._groups or [])
assert installer_groups == {MAIN_GROUP, "test", "dev"}

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.13) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.11) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.13) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.10) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.12) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.12) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.9) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.10) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.9) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / Ubuntu (Python 3.14) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.11) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View check run for this annotation

Cirrus CI / Tests / FreeBSD (Python 3.11) / pytest

tests/console/commands/test_default_group_optionality.py#L134

tests.console.commands.test_default_group_optionality.test_with_default_group_optionality_and_with_option
Raw output
install_tester = <cleo.testers.command_tester.CommandTester object at 0x307f105306d0>
mocker = <pytest_mock.plugin.MockerFixture object at 0x307f1219f910>

    def test_with_default_group_optionality_and_with_option(
        install_tester: CommandTester, mocker: MockerFixture
    ) -> None:
        """
        With default-group-optionality enabled, --with can explicitly include groups.
        """
        # Enable the configuration
        install_tester.command.poetry.config.merge({"default-group-optionality": True})
    
        mocker.patch.object(install_tester.command.installer, "run", return_value=0)
        mocker.patch(
            "poetry.masonry.builders.editable.EditableBuilder",
            side_effect=Exception("Should not be called"),
        )
    
        status_code = install_tester.execute("--no-root --with test,dev")
        assert status_code == 0
    
        # Should install main, test, and dev groups
        installer_groups = set(install_tester.command.installer._groups or [])
>       assert installer_groups == {MAIN_GROUP, "test", "dev"}
E       AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'}
E         
E         Extra items in the right set:
E         'main'
E         
E         Full diff:
E           {
E               'dev',
E         -     'main',
E               'test',
E           }

/tmp/cirrus-ci-build/tests/console/commands/test_default_group_optionality.py:134: AssertionError

Check failure on line 134 in tests/console/commands/test_default_group_optionality.py

View workflow job for this annotation

GitHub Actions / macOS aarch64 (Python 3.14) / pytest

test_with_default_group_optionality_and_with_option AssertionError: assert {'dev', 'test'} == {'dev', 'main', 'test'} Extra items in the right set: 'main' Full diff: { 'dev', - 'main', 'test', }


def test_with_default_group_optionality_and_only_option(
install_tester: CommandTester, mocker: MockerFixture
) -> None:
"""
With default-group-optionality enabled, --only still works as expected.
"""
# Enable the configuration
install_tester.command.poetry.config.merge({"default-group-optionality": True})

mocker.patch.object(install_tester.command.installer, "run", return_value=0)
mocker.patch(
"poetry.masonry.builders.editable.EditableBuilder",
side_effect=Exception("Should not be called"),
)

status_code = install_tester.execute("--no-root --only test")
assert status_code == 0

# Should only install test group
installer_groups = set(install_tester.command.installer._groups or [])
assert installer_groups == {"test"}


def test_config_get_default_group_optionality(config_tester: CommandTester) -> None:
"""
Test getting the default-group-optionality configuration value.
"""
config_tester.execute("default-group-optionality")
assert config_tester.status_code == 0
assert "false" in config_tester.io.fetch_output().strip().lower()


def test_config_set_default_group_optionality(config_tester: CommandTester) -> None:
"""
Test setting the default-group-optionality configuration value.
"""
config_tester.execute("--local default-group-optionality true")
assert config_tester.status_code == 0

config_tester.io.clear_output()
config_tester.execute("--local default-group-optionality")
assert config_tester.status_code == 0
assert "true" in config_tester.io.fetch_output().strip().lower()


def test_config_unset_default_group_optionality(config_tester: CommandTester) -> None:
"""
Test unsetting the default-group-optionality configuration value.
"""
config_tester.execute("--local default-group-optionality true")
assert config_tester.status_code == 0

config_tester.execute("--local default-group-optionality --unset")
assert config_tester.status_code == 0

config_tester.io.clear_output()
config_tester.execute("default-group-optionality")
assert config_tester.status_code == 0
# Should revert to default (false)
assert "false" in config_tester.io.fetch_output().strip().lower()


def test_backward_compatibility(
install_tester: CommandTester, mocker: MockerFixture
) -> None:
"""
Test that existing behavior is maintained when config is not set.
"""
mocker.patch.object(install_tester.command.installer, "run", return_value=0)
mocker.patch(
"poetry.masonry.builders.editable.EditableBuilder",
side_effect=Exception("Should not be called"),
)

# Without setting the config, behavior should be unchanged
status_code = install_tester.execute("--no-root")
assert status_code == 0

installer_groups = set(install_tester.command.installer._groups or [])
# test and dev should be included by default (not docs since it's optional)
assert installer_groups == {MAIN_GROUP, "test", "dev"}
Loading