<p dir="ltr">Awesome +0.99 think this sounds great to me.</p>
<p dir="ltr">The only thing that I would like personally I think is that the behavior for PYTHON envvars to not be cleared, for them to either persist by default as well or for appropriate defaults for tests be set (in some ways it&#39;s the test runner&#39;s responsibility to do the latter IMO but not all of them do so unfortunately).</p>
<p dir="ltr">E.g. for reasons I haven&#39;t spent time deciphering, current tox unsets PYTHONDONTWRITEBYTECODE, which is pretty annoying (there&#39;s a comment about legacy something or other). I&#39;d probably expect all of those envvars to persist or say in the case of PYTHONWARNINGS to be set to a more test suitable value like `default`.</p>
<p dir="ltr">-J</p>
<div class="gmail_quote">On Apr 19, 2015 9:31 AM, &quot;holger krekel&quot; &lt;<a href="mailto:holger@merlinux.eu">holger@merlinux.eu</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi tox users,<br>
<br>
for tox-2.0 i&#39;d like to introduce environment variable isolation.  The<br>
idea is that only a minimal default set of environment variables is<br>
transferred to the test environment in contrast to the tox&lt;2.0 where<br>
all environment variables are copied to the test run.  With tox-2.0 one<br>
can thus make sure tests don&#39;t depend on random env variables but only<br>
those which are specified with tox.ini.<br>
<br>
If you want to transfer any other variables you&#39;d have to use a new &quot;passenv&quot;<br>
setting.  For example to pass through the content of LANG (used for locale settings)<br>
and typical home-directory settings (on win32 and unix):<br>
<br>
    [testenv]<br>
    passenv = LANG HOME HOMEDIR HOMEDRIVE<br>
<br>
If an env variable does not exist it is ignored, remains unset in the test run.<br>
This allows to uncover hidden envvar dependencies and explicitely control them.<br>
FYI you can today already use the &quot;setenv&quot; option to specify env vars::<br>
<br>
    [testenv]<br>
    setenv =<br>
        MYENV = somesetting<br>
<br>
But there is no way to prevent/exclude env variables to be copied to the test run<br>
from the environment variable set with which you invoke tox.<br>
<br>
For a somewhat smoother transition it might make sense to default to the<br>
old behaviour (transfer all env variables) with tox-2.0.X and assume passenv<br>
transfers all variables via a default &quot;*&quot; setting but issue a warning<br>
and with tox-2.1 then default to an empty passenv setting.<br>
<br>
comments welcome,<br>
holger<br>
<br>
--<br>
about me:    <a href="http://holgerkrekel.net/about-me/" target="_blank">http://holgerkrekel.net/about-me/</a><br>
contracting: <a href="http://merlinux.eu" target="_blank">http://merlinux.eu</a><br>
<br>
_______________________________________________<br>
testing-in-python mailing list<br>
<a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
<a href="http://lists.idyll.org/listinfo/testing-in-python" target="_blank">http://lists.idyll.org/listinfo/testing-in-python</a><br>
</blockquote></div>