Skip to content

Commit 170a2c5

Browse files
committed
testing/test_config: check inipath instead of inifile
inifile is soft-deprecated in favor of inipath.
1 parent 8b220fa commit 170a2c5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

testing/test_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from typing import Union
1212

1313
import attr
14-
import py.path
1514

1615
import _pytest._code
1716
import pytest
@@ -28,6 +27,7 @@
2827
from _pytest.config.findpaths import get_common_ancestor
2928
from _pytest.config.findpaths import locate_config
3029
from _pytest.monkeypatch import MonkeyPatch
30+
from _pytest.pathlib import absolutepath
3131
from _pytest.pytester import Pytester
3232

3333

@@ -854,8 +854,8 @@ def test_inifilename(self, tmp_path: Path) -> None:
854854
)
855855
)
856856

857-
inifile = "../../foo/bar.ini"
858-
option_dict = {"inifilename": inifile, "capture": "no"}
857+
inifilename = "../../foo/bar.ini"
858+
option_dict = {"inifilename": inifilename, "capture": "no"}
859859

860860
cwd = tmp_path.joinpath("a/b")
861861
cwd.mkdir(parents=True)
@@ -873,14 +873,14 @@ def test_inifilename(self, tmp_path: Path) -> None:
873873
with MonkeyPatch.context() as mp:
874874
mp.chdir(cwd)
875875
config = Config.fromdictargs(option_dict, ())
876-
inipath = py.path.local(inifile)
876+
inipath = absolutepath(inifilename)
877877

878878
assert config.args == [str(cwd)]
879-
assert config.option.inifilename == inifile
879+
assert config.option.inifilename == inifilename
880880
assert config.option.capture == "no"
881881

882882
# this indicates this is the file used for getting configuration values
883-
assert config.inifile == inipath
883+
assert config.inipath == inipath
884884
assert config.inicfg.get("name") == "value"
885885
assert config.inicfg.get("should_not_be_set") is None
886886

0 commit comments

Comments
 (0)