-
-
Notifications
You must be signed in to change notification settings - Fork 540
Description
Issue
Dug a bit into #3555. The first issue was a bit of confusion over the env var naming scheme. The CLI displays a metavar of factor
, but the actual argument dest is factors
, so the env var lookups are TOXFACTORS
/TOX_FACTORS
, not TOXFACTOR
/TOX_FACTOR
. You can't really determine what the env vars should be without looking through the source code, and I don't know if there's an easy or good way to convey this in the CLI help text. Regardless, this was a bit confusing.
As to the actual bug, factor parsing is broken when provided by an env var. I've debugged this as far as I can for now, but essentially it seems that get_env_var
converts the env value to a list, but EnvSelector._parse_factors
is expecting the raw_factors
to be a list of lists. This can be demonstrated with:
TOX_FACTORS="3.12 django" tox -f 3.13 django r
Setting a breakpoint in EnvSelector._mark_active
, the parsed factors
are:
({'o', '1', ' ', 'd', '2', 'g', '3', 'a', 'n', '.', 'j'}, {'3.13', 'django'})
Minimal example
$ tox -f 3.13 l
3.13 -> run the tests with pytest under 3.13
$ TOX_FACTORS=3.13 tox l
$