diff --git a/src/tox/session/env_select.py b/src/tox/session/env_select.py index 6a09879af..a654eaa49 100644 --- a/src/tox/session/env_select.py +++ b/src/tox/session/env_select.py @@ -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 diff --git a/tests/session/test_env_select.py b/tests/session/test_env_select.py index 102c22ce0..80a0043fe 100644 --- a/tests/session/test_env_select.py +++ b/tests/session/test_env_select.py @@ -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),