summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürgen Gmach <juergen.gmach@googlemail.com>2021-04-13 19:51:56 +0200
committerJürgen Gmach <juergen.gmach@googlemail.com>2021-04-13 19:51:56 +0200
commit850c23194838e92f7b488d78c5f9297069253515 (patch)
tree6e3173bbf060b2434e76c697e08314c6f099a87c
parent61ec5e79067d3aafcab28822837759b0d1a4bc99 (diff)
downloadtox-git-issue_2002.tar.gz
Move testsissue_2002
-rw-r--r--tests/config/loader/ini/test_factor.py26
-rw-r--r--tests/config/loader/ini/test_ini_loader.py22
2 files changed, 25 insertions, 23 deletions
diff --git a/tests/config/loader/ini/test_factor.py b/tests/config/loader/ini/test_factor.py
index b3ad4bc4..c1888eeb 100644
--- a/tests/config/loader/ini/test_factor.py
+++ b/tests/config/loader/ini/test_factor.py
@@ -1,10 +1,13 @@
+from configparser import ConfigParser
from textwrap import dedent
-from typing import List
+from typing import Callable, List
import pytest
from tests.conftest import ToxIniCreator
+from tox.config.loader.ini import IniLoader
from tox.config.loader.ini.factor import filter_for_env, find_envs
+from tox.config.main import Config
def test_factor_env_discover_empty() -> None:
@@ -146,3 +149,24 @@ def test_factor_config_no_env_list_creates_env(tox_ini_conf: ToxIniCreator) -> N
)
assert list(config) == ["py37-django15", "py37-django16", "py36"]
+
+
+@pytest.mark.parametrize(
+ ("env", "result"),
+ [
+ ("py35", "python -m coverage html -d cov"),
+ ("py36", "python -m coverage html -d cov\n--show-contexts"),
+ ],
+)
+def test_ini_loader_raw_with_factors(
+ mk_ini_conf: Callable[[str], ConfigParser], env: str, result: str, empty_config: Config
+) -> None:
+ commands = "python -m coverage html -d cov \n !py35: --show-contexts"
+ loader = IniLoader(
+ section="testenv",
+ parser=mk_ini_conf(f"[tox]\nenvlist=py35,py36\n[testenv]\ncommands={commands}"),
+ overrides=[],
+ core_prefix="tox",
+ )
+ outcome = loader.load_raw(key="commands", conf=empty_config, env_name=env)
+ assert outcome == result
diff --git a/tests/config/loader/ini/test_ini_loader.py b/tests/config/loader/ini/test_ini_loader.py
index 187b723a..ac0f17df 100644
--- a/tests/config/loader/ini/test_ini_loader.py
+++ b/tests/config/loader/ini/test_ini_loader.py
@@ -5,7 +5,6 @@ import pytest
from tox.config.loader.api import Override
from tox.config.loader.ini import IniLoader
-from tox.config.main import Config
def test_ini_loader_keys(mk_ini_conf: Callable[[str], ConfigParser]) -> None:
@@ -57,24 +56,3 @@ def test_ini_loader_strip_comments(mk_ini_conf: Callable[[str], ConfigParser], c
loader = IniLoader("tox", mk_ini_conf(f"[tox]\na={case}"), [], core_prefix="tox")
outcome = loader.load(key="a", of_type=str, conf=None, env_name=None, chain=[], kwargs={})
assert outcome == result
-
-
-@pytest.mark.parametrize(
- ("env", "result"),
- [
- ("py35", "python -m coverage html -d cov"),
- ("py36", "python -m coverage html -d cov\n--show-contexts"),
- ],
-)
-def test_ini_loader_raw_with_factors(
- mk_ini_conf: Callable[[str], ConfigParser], env: str, result: str, empty_config: Config
-) -> None:
- commands = "python -m coverage html -d cov \n !py35: --show-contexts"
- loader = IniLoader(
- section="testenv",
- parser=mk_ini_conf(f"[tox]\nenvlist=py35,py36\n[testenv]\ncommands={commands}"),
- overrides=[],
- core_prefix="tox",
- )
- outcome = loader.load_raw(key="commands", conf=empty_config, env_name=env)
- assert outcome == result