How to set the environment variable in tox?
setenv must be in [testenv]: [tox] envlist = py35 [testenv] deps=pytest commands=py.test setenv = XYZ = 123
setenv must be in [testenv]: [tox] envlist = py35 [testenv] deps=pytest commands=py.test setenv = XYZ = 123
You can use passenv. If you pass the catch all wildcard * you have access to all environment variables from the parent environment: passenv=SPACE-SEPARATED-GLOBNAMES New in version 2.0. A list of wildcard environment variable names which shall be copied from the tox invocation environment to the test environment when executing test commands. If a specified … Read more
SetEnv sets a particular variable to some value, so you need something like SetEnv varname varvalue If this is for a specific virtual host, and you have access to the Apache configuration files, this would go inside the <VirtualHost> directive for that virtual host. If you don’t have control of the config files, you’ll need … Read more
[The] putenv(char *string); […] call seems fatally flawed. Yes, it is fatally flawed. It was preserved in POSIX (1988) because that was the prior art. The setenv() mechanism arrived later. Correction: The POSIX 1990 standard says in §B.4.6.1 “Additional functions putenv() and clearenv() were considered but rejected”. The Single Unix Specification (SUS) version 2 from … Read more