Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.env_select.CliEnv: Document and test spaces behaviour #3208

Merged
merged 1 commit into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/tox/session/env_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@


class CliEnv: # noqa: PLW1641
"""A `CliEnv` is the user's selection of tox test environments, usually supplied via the ``-e`` command-line
option. It may be treated as a sequence if it's not a "default" or "all" selection.
"""A `CliEnv` is the user's selection of tox test environments, usually supplied via the ``-e`` command-line option
or in a TOML file (typically ``env_list`` in ``tox.ini``). It may be treated as a sequence if it's not a "default"
or "all" selection.

It is in one of three forms:

- A list of specific environments, instantiated with a string that is a comma-separated list of the environment
names. As a sequence this will be a sequence of those names.
names. (These may have spaces on either side of the commas which are removed.) As a sequence this will be a
sequence of those names.

- "ALL" which is all environments defined by the tox configuration. This is instantiated with ``ALL`` either
alone or as any element of a comma-separated list; any other environment names are ignored. `is_all()` will be
Expand Down
1 change: 1 addition & 0 deletions tests/session/test_env_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
("", (), False, True),
("a1", ("a1",), False, False),
("a1,b2,c3", ("a1", "b2", "c3"), False, False),
(" a1, b2 , c3 ", ("a1", "b2", "c3"), False, False),
# If the user gives "ALL" as any envname, this becomes an "is_all" and other envnames are ignored.
("ALL", (), True, False),
("a1,ALL,b2", (), True, False),
Expand Down