@@ -51,14 +51,14 @@ def test_set_env_bad_line() -> None:
5151 SetEnv ("A" , "py" , "py" , Path ())
5252
5353
54- _ConfType = Literal ["ini" , "toml" ]
54+ ConfigFileFormat = Literal ["ini" , "toml" ]
5555
5656
5757class EvalSetEnv (Protocol ):
5858 def __call__ (
5959 self ,
6060 config : str ,
61- conf_type : _ConfType = "ini" ,
61+ conf_type : ConfigFileFormat = "ini" ,
6262 extra_files : dict [str , Any ] | None = ...,
6363 from_cwd : Path | None = ...,
6464 ) -> SetEnv : ...
@@ -68,14 +68,11 @@ def __call__(
6868def eval_set_env (tox_project : ToxProjectCreator ) -> EvalSetEnv :
6969 def func (
7070 config : str ,
71- conf_type : _ConfType = "ini" ,
71+ conf_type : ConfigFileFormat = "ini" ,
7272 extra_files : dict [str , Any ] | None = None ,
7373 from_cwd : Path | None = None ,
7474 ) -> SetEnv :
75- if conf_type == "ini" :
76- prj = tox_project ({"tox.ini" : config , ** (extra_files or {})})
77- else :
78- prj = tox_project ({"tox.toml" : config , ** (extra_files or {})})
75+ prj = tox_project ({f"tox.{ conf_type } " : config , ** (extra_files or {})})
7976 result = prj .run ("c" , "-k" , "set_env" , "-e" , "py" , from_cwd = None if from_cwd is None else prj .path / from_cwd )
8077 result .assert_success ()
8178 set_env : SetEnv = result .env_conf ("py" )["set_env" ]
@@ -172,7 +169,7 @@ def test_set_env_honor_override(eval_set_env: EvalSetEnv) -> None:
172169 ],
173170)
174171def test_set_env_environment_file (
175- conf_type : _ConfType , config : str , eval_set_env : EvalSetEnv , monkeypatch : MonkeyPatch
172+ conf_type : ConfigFileFormat , config : str , eval_set_env : EvalSetEnv , monkeypatch : MonkeyPatch
176173) -> None :
177174 env_file = """
178175 A=1
@@ -211,7 +208,7 @@ def test_set_env_environment_file(
211208 ],
212209)
213210def test_set_env_environment_file_combined_with_normal_setting (
214- conf_type : _ConfType , config : str , eval_set_env : EvalSetEnv , monkeypatch : MonkeyPatch
211+ conf_type : ConfigFileFormat , config : str , eval_set_env : EvalSetEnv , monkeypatch : MonkeyPatch
215212) -> None :
216213 env_file = """
217214 A=1
0 commit comments