summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBernát Gábor <gaborjbernat@gmail.com>2022-12-18 08:19:38 -0800
committerGitHub <noreply@github.com>2022-12-18 08:19:38 -0800
commit569268a4bd34bddfceadcccaed6bd8e0cc9316f4 (patch)
tree3e22bf8279da4a7f96501855aee25e07c40ddc8e /tests
parent50985fe1bbb44f8126cc3f52d3a3079b0b80dc55 (diff)
downloadtox-git-569268a4bd34bddfceadcccaed6bd8e0cc9316f4.tar.gz
Ignore non-test section names and invalid factor filters (#2748)
Resolves https://github.com/tox-dev/tox/issues/2746
Diffstat (limited to 'tests')
-rw-r--r--tests/config/source/test_source_ini.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/config/source/test_source_ini.py b/tests/config/source/test_source_ini.py
index c3162486..5d61290b 100644
--- a/tests/config/source/test_source_ini.py
+++ b/tests/config/source/test_source_ini.py
@@ -10,3 +10,15 @@ def test_source_ini_with_interpolated(tmp_path: Path) -> None:
loader = IniSource(tmp_path, content="[tox]\na = %(c)s").get_loader(Section(None, "tox"), {})
assert loader is not None
loader.load_raw("a", None, None)
+
+
+def test_source_ini_ignore_non_testenv_sections(tmp_path: Path) -> None:
+ loader = IniSource(tmp_path, content="[mypy-rest_framework.compat.*]")
+ res = list(loader.envs({"env_list": []})) # type: ignore
+ assert not res
+
+
+def test_source_ini_ignore_invalid_factor_filters(tmp_path: Path) -> None:
+ loader = IniSource(tmp_path, content="[a]\nb= if c: d")
+ res = list(loader.envs({"env_list": []})) # type: ignore
+ assert not res