Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tox/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ def __init__(self, envname, config, factors, reader):
#: set of factors
self.factors = factors
self._reader = reader
self.missing_subs = []
self._missing_subs = []
"""Holds substitutions that could not be resolved.

Pre 2.8.1 missing substitutions crashed with a ConfigError although this would not be a
Expand Down Expand Up @@ -1233,7 +1233,7 @@ def make_envconfig(self, name, section, subs, config, replace=True):
if env_attr.postprocess:
res = env_attr.postprocess(testenv_config=tc, value=res)
except tox.exception.MissingSubstitution as e:
tc.missing_subs.append(e.name)
tc._missing_subs.append(e.name)
res = e.FLAG
setattr(tc, env_attr.name, res)
if atype in ("path", "string", "basepython"):
Expand Down
4 changes: 2 additions & 2 deletions src/tox/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,11 +575,11 @@ def _pcall(
)

def setupenv(self):
if self.envconfig.missing_subs:
if self.envconfig._missing_subs:
self.status = (
"unresolvable substitution(s): {}. "
"Environment variables are missing or defined recursively.".format(
",".join(["'{}'".format(m) for m in self.envconfig.missing_subs])
",".join(["'{}'".format(m) for m in self.envconfig._missing_subs])
)
)
return
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def test_missing_env_sub_raises_config_error_in_non_testenv(self, newconfig):
def test_missing_env_sub_populates_missing_subs(self, newconfig):
config = newconfig("[testenv:foo]\ncommands={env:VAR}")
print(SectionReader("section", config._cfg).getstring("commands"))
assert config.envconfigs["foo"].missing_subs == ["VAR"]
assert config.envconfigs["foo"]._missing_subs == ["VAR"]

def test_getstring_environment_substitution_with_default(self, monkeypatch, newconfig):
monkeypatch.setenv("KEY1", "hello")
Expand Down