Hi, I am trying to use pants to execute python tes...
# general
m
Hi, I am trying to use pants to execute python tests. I am quite new to pants so please be patient. I defined a
local_environment
in my top leven BUILD file:
Copy code
local_environment(
    name="local-environment",
    subprocess_environment_env_vars=env_vars_devcontainer(),
)
where the environment variables are defined in my macros.py. Furthermode I added this environment to my pants.toml:
Copy code
[environments-preview.names]
local = "//:local-environment"
As far as I understand this environment is automatically used when I run
pants test
. However, there is one environment variable which needs (for some reason) a different value when used in tests, lets say when using it locally it outside of tests it should be
ENV_VAR=true
and when tests are run it should be
ENV_VAR=false
. I can achieve this using
ENV_VAR=false pants test
, however, I don't like this solution and would like to (somehow) set it in the config. Is there a possibility to do that? I tried setting
Copy code
[test]
extra_env_vars = ["ENV_VAR=false"]
in the pants.toml but that is somehow ignored by pants.