[TIP] RFC: tox-2.0 to restrict/isolate env variables in test runs

Robert Collins robertc at robertcollins.net
Sun Apr 19 00:42:18 PDT 2015


On 19 April 2015 at 19:31, holger krekel <holger at merlinux.eu> wrote:
> Hi tox users,
>
> for tox-2.0 i'd like to introduce environment variable isolation.  The
> idea is that only a minimal default set of environment variables is
> transferred to the test environment in contrast to the tox<2.0 where
> all environment variables are copied to the test run.  With tox-2.0 one
> can thus make sure tests don't depend on random env variables but only
> those which are specified with tox.ini.
>
> If you want to transfer any other variables you'd have to use a new "passenv"
> setting.  For example to pass through the content of LANG (used for locale settings)
> and typical home-directory settings (on win32 and unix):
>
>     [testenv]
>     passenv = LANG HOME HOMEDIR HOMEDRIVE
>...
> For a somewhat smoother transition it might make sense to default to the
> old behaviour (transfer all env variables) with tox-2.0.X and assume passenv
> transfers all variables via a default "*" setting but issue a warning
> and with tox-2.1 then default to an empty passenv setting.

I'd expect a major change like that in 2.0, not in 2.1. (semver :)).

Having wildcards in the passenv expression would be useful for some situations.

-Rob

-- 
Robert Collins <rbtcollins at hp.com>
Distinguished Technologist
HP Converged Cloud



More information about the testing-in-python mailing list