Skip to content

Commit bc31722

Browse files
authored
envconfig.missing_subs is not a setting: should be a private attribute (#1335)
1 parent bed76e6 commit bc31722

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/tox/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ def __init__(self, envname, config, factors, reader):
883883
#: set of factors
884884
self.factors = factors
885885
self._reader = reader
886-
self.missing_subs = []
886+
self._missing_subs = []
887887
"""Holds substitutions that could not be resolved.
888888
889889
Pre 2.8.1 missing substitutions crashed with a ConfigError although this would not be a
@@ -1233,7 +1233,7 @@ def make_envconfig(self, name, section, subs, config, replace=True):
12331233
if env_attr.postprocess:
12341234
res = env_attr.postprocess(testenv_config=tc, value=res)
12351235
except tox.exception.MissingSubstitution as e:
1236-
tc.missing_subs.append(e.name)
1236+
tc._missing_subs.append(e.name)
12371237
res = e.FLAG
12381238
setattr(tc, env_attr.name, res)
12391239
if atype in ("path", "string", "basepython"):

src/tox/venv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,11 +575,11 @@ def _pcall(
575575
)
576576

577577
def setupenv(self):
578-
if self.envconfig.missing_subs:
578+
if self.envconfig._missing_subs:
579579
self.status = (
580580
"unresolvable substitution(s): {}. "
581581
"Environment variables are missing or defined recursively.".format(
582-
",".join(["'{}'".format(m) for m in self.envconfig.missing_subs])
582+
",".join(["'{}'".format(m) for m in self.envconfig._missing_subs])
583583
)
584584
)
585585
return

tests/unit/config/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ def test_missing_env_sub_raises_config_error_in_non_testenv(self, newconfig):
556556
def test_missing_env_sub_populates_missing_subs(self, newconfig):
557557
config = newconfig("[testenv:foo]\ncommands={env:VAR}")
558558
print(SectionReader("section", config._cfg).getstring("commands"))
559-
assert config.envconfigs["foo"].missing_subs == ["VAR"]
559+
assert config.envconfigs["foo"]._missing_subs == ["VAR"]
560560

561561
def test_getstring_environment_substitution_with_default(self, monkeypatch, newconfig):
562562
monkeypatch.setenv("KEY1", "hello")

0 commit comments

Comments
 (0)