11
11
from typing import Union
12
12
13
13
import attr
14
- import py .path
15
14
16
15
import _pytest ._code
17
16
import pytest
28
27
from _pytest .config .findpaths import get_common_ancestor
29
28
from _pytest .config .findpaths import locate_config
30
29
from _pytest .monkeypatch import MonkeyPatch
30
+ from _pytest .pathlib import absolutepath
31
31
from _pytest .pytester import Pytester
32
32
33
33
@@ -854,8 +854,8 @@ def test_inifilename(self, tmp_path: Path) -> None:
854
854
)
855
855
)
856
856
857
- inifile = "../../foo/bar.ini"
858
- option_dict = {"inifilename" : inifile , "capture" : "no" }
857
+ inifilename = "../../foo/bar.ini"
858
+ option_dict = {"inifilename" : inifilename , "capture" : "no" }
859
859
860
860
cwd = tmp_path .joinpath ("a/b" )
861
861
cwd .mkdir (parents = True )
@@ -873,14 +873,14 @@ def test_inifilename(self, tmp_path: Path) -> None:
873
873
with MonkeyPatch .context () as mp :
874
874
mp .chdir (cwd )
875
875
config = Config .fromdictargs (option_dict , ())
876
- inipath = py . path . local ( inifile )
876
+ inipath = absolutepath ( inifilename )
877
877
878
878
assert config .args == [str (cwd )]
879
- assert config .option .inifilename == inifile
879
+ assert config .option .inifilename == inifilename
880
880
assert config .option .capture == "no"
881
881
882
882
# this indicates this is the file used for getting configuration values
883
- assert config .inifile == inipath
883
+ assert config .inipath == inipath
884
884
assert config .inicfg .get ("name" ) == "value"
885
885
assert config .inicfg .get ("should_not_be_set" ) is None
886
886
0 commit comments