Skip to content

Commit 3796ae0

Browse files
committed
Use py.iniconfig._SectionWrapper
1 parent a129dc3 commit 3796ae0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/_pytest/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def _getini(self, name: str) -> Any:
10931093
return ""
10941094
return []
10951095
if type == "pathlist":
1096-
assert isinstance(self.inicfg, py.iniconfig.SectionWrapper)
1096+
assert isinstance(self.inicfg, py.iniconfig._SectionWrapper), self.inicfg
10971097
dp = py.path.local(self.inicfg.config.path).dirpath()
10981098
values = []
10991099
for relpath in shlex.split(value):

src/_pytest/config/findpaths.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
if TYPE_CHECKING:
1616
from . import Config # noqa: F401
1717

18+
from py.iniconfig import _SectionWrapper # noqa: F401
19+
1820

1921
def exists(path, ignore=EnvironmentError):
2022
try:
@@ -24,11 +26,11 @@ def exists(path, ignore=EnvironmentError):
2426

2527

2628
def getcfg(
27-
args: Iterable[py.path.local], config: Optional[Config] = None
29+
args: Iterable[py.path.local], config: Optional["Config"] = None
2830
) -> Tuple[
2931
Optional[py.path.local],
3032
Optional[py.path.local],
31-
Union[py.iniconfig.SectionWrapper, Dict, None],
33+
Union["_SectionWrapper", Dict, None],
3234
]:
3335
"""
3436
Search the list of arguments for a valid ini-file for pytest,
@@ -123,7 +125,7 @@ def determine_setup(
123125
args: List[str],
124126
rootdir_cmd_arg: Optional[str] = None,
125127
config: Optional["Config"] = None,
126-
) -> Tuple[py.path.local, py.path.local, Union[py.iniconfig.SectionWrapper, Dict]]:
128+
) -> Tuple[py.path.local, py.path.local, Union["_SectionWrapper", Dict]]:
127129
dirs = get_dirs_from_args(args)
128130
if inifile:
129131
iniconfig = py.iniconfig.IniConfig(inifile)

0 commit comments

Comments
 (0)