@@ -1631,6 +1631,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None:
16311631 for args in ([str (tmp_path )], [str (a )], [str (b )]):
16321632 rootpath , parsed_inipath , * _ = determine_setup (
16331633 inifile = None ,
1634+ override_ini = None ,
16341635 args = args ,
16351636 rootdir_cmd_arg = None ,
16361637 invocation_dir = Path .cwd (),
@@ -1639,6 +1640,7 @@ def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None:
16391640 assert parsed_inipath == inipath
16401641 rootpath , parsed_inipath , ini_config , _ = determine_setup (
16411642 inifile = None ,
1643+ override_ini = None ,
16421644 args = [str (b ), str (a )],
16431645 rootdir_cmd_arg = None ,
16441646 invocation_dir = Path .cwd (),
@@ -1656,6 +1658,7 @@ def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> Non
16561658 (a / name ).touch ()
16571659 rootpath , parsed_inipath , * _ = determine_setup (
16581660 inifile = None ,
1661+ override_ini = None ,
16591662 args = [str (a )],
16601663 rootdir_cmd_arg = None ,
16611664 invocation_dir = Path .cwd (),
@@ -1670,6 +1673,7 @@ def test_setuppy_fallback(self, tmp_path: Path) -> None:
16701673 (tmp_path / "setup.py" ).touch ()
16711674 rootpath , inipath , inicfg , _ = determine_setup (
16721675 inifile = None ,
1676+ override_ini = None ,
16731677 args = [str (a )],
16741678 rootdir_cmd_arg = None ,
16751679 invocation_dir = Path .cwd (),
@@ -1682,6 +1686,7 @@ def test_nothing(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None:
16821686 monkeypatch .chdir (tmp_path )
16831687 rootpath , inipath , inicfg , _ = determine_setup (
16841688 inifile = None ,
1689+ override_ini = None ,
16851690 args = [str (tmp_path )],
16861691 rootdir_cmd_arg = None ,
16871692 invocation_dir = Path .cwd (),
@@ -1709,6 +1714,7 @@ def test_with_specific_inifile(
17091714 p .write_text (contents , encoding = "utf-8" )
17101715 rootpath , inipath , ini_config , _ = determine_setup (
17111716 inifile = str (p ),
1717+ override_ini = None ,
17121718 args = [str (tmp_path )],
17131719 rootdir_cmd_arg = None ,
17141720 invocation_dir = Path .cwd (),
@@ -1728,6 +1734,7 @@ def test_explicit_config_file_sets_rootdir(
17281734 # No config file is explicitly given: rootdir is determined to be cwd.
17291735 rootpath , found_inipath , * _ = determine_setup (
17301736 inifile = None ,
1737+ override_ini = None ,
17311738 args = [str (tests_dir )],
17321739 rootdir_cmd_arg = None ,
17331740 invocation_dir = Path .cwd (),
@@ -1740,6 +1747,7 @@ def test_explicit_config_file_sets_rootdir(
17401747 inipath .touch ()
17411748 rootpath , found_inipath , * _ = determine_setup (
17421749 inifile = str (inipath ),
1750+ override_ini = None ,
17431751 args = [str (tests_dir )],
17441752 rootdir_cmd_arg = None ,
17451753 invocation_dir = Path .cwd (),
@@ -1757,6 +1765,7 @@ def test_with_arg_outside_cwd_without_inifile(
17571765 b .mkdir ()
17581766 rootpath , inifile , * _ = determine_setup (
17591767 inifile = None ,
1768+ override_ini = None ,
17601769 args = [str (a ), str (b )],
17611770 rootdir_cmd_arg = None ,
17621771 invocation_dir = Path .cwd (),
@@ -1773,6 +1782,7 @@ def test_with_arg_outside_cwd_with_inifile(self, tmp_path: Path) -> None:
17731782 inipath .touch ()
17741783 rootpath , parsed_inipath , * _ = determine_setup (
17751784 inifile = None ,
1785+ override_ini = None ,
17761786 args = [str (a ), str (b )],
17771787 rootdir_cmd_arg = None ,
17781788 invocation_dir = Path .cwd (),
@@ -1787,6 +1797,7 @@ def test_with_non_dir_arg(
17871797 monkeypatch .chdir (tmp_path )
17881798 rootpath , inipath , * _ = determine_setup (
17891799 inifile = None ,
1800+ override_ini = None ,
17901801 args = dirs ,
17911802 rootdir_cmd_arg = None ,
17921803 invocation_dir = Path .cwd (),
@@ -1803,6 +1814,7 @@ def test_with_existing_file_in_subdir(
18031814 monkeypatch .chdir (tmp_path )
18041815 rootpath , inipath , * _ = determine_setup (
18051816 inifile = None ,
1817+ override_ini = None ,
18061818 args = ["a/exist" ],
18071819 rootdir_cmd_arg = None ,
18081820 invocation_dir = Path .cwd (),
@@ -1822,6 +1834,7 @@ def test_with_config_also_in_parent_directory(
18221834
18231835 rootpath , inipath , * _ = determine_setup (
18241836 inifile = None ,
1837+ override_ini = None ,
18251838 args = ["tests/" ],
18261839 rootdir_cmd_arg = None ,
18271840 invocation_dir = Path .cwd (),
@@ -1978,7 +1991,7 @@ def test_addopts_before_initini(
19781991 monkeypatch .setenv ("PYTEST_ADDOPTS" , f"-o cache_dir={ cache_dir } " )
19791992 config = _config_for_test
19801993 config ._preparse ([], addopts = True )
1981- assert config ._override_ini == [ f" cache_dir= { cache_dir } " ]
1994+ assert config .inicfg . get ( "cache_dir" ) == cache_dir
19821995
19831996 def test_addopts_from_env_not_concatenated (
19841997 self , monkeypatch : MonkeyPatch , _config_for_test
@@ -2016,7 +2029,7 @@ def test_override_ini_does_not_contain_paths(
20162029 """Check that -o no longer swallows all options after it (#3103)"""
20172030 config = _config_for_test
20182031 config ._preparse (["-o" , "cache_dir=/cache" , "/some/test/path" ])
2019- assert config ._override_ini == [ "cache_dir= /cache"]
2032+ assert config .inicfg . get ( "cache_dir" ) == " /cache"
20202033
20212034 def test_multiple_override_ini_options (self , pytester : Pytester ) -> None :
20222035 """Ensure a file path following a '-o' option does not generate an error (#3103)"""
0 commit comments