7291: Replace py.iniconfig with iniconfig
This commit is contained in:
parent
2f406bb9cb
commit
2748feed38
|
@ -0,0 +1 @@
|
|||
Replaced usages of py.iniconfig with iniconfig.
|
1
setup.py
1
setup.py
|
@ -12,6 +12,7 @@ INSTALL_REQUIRES = [
|
|||
'colorama;sys_platform=="win32"',
|
||||
"pluggy>=0.12,<1.0",
|
||||
'importlib-metadata>=0.12;python_version<"3.8"',
|
||||
"iniconfig",
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ from typing import Optional
|
|||
from typing import Tuple
|
||||
|
||||
import py
|
||||
from iniconfig import IniConfig
|
||||
from iniconfig import ParseError
|
||||
|
||||
from .exceptions import UsageError
|
||||
from _pytest.compat import TYPE_CHECKING
|
||||
|
@ -40,8 +42,8 @@ def getcfg(args, config=None):
|
|||
p = base.join(inibasename)
|
||||
if exists(p):
|
||||
try:
|
||||
iniconfig = py.iniconfig.IniConfig(p)
|
||||
except py.iniconfig.ParseError as exc:
|
||||
iniconfig = IniConfig(p)
|
||||
except ParseError as exc:
|
||||
raise UsageError(str(exc))
|
||||
|
||||
if (
|
||||
|
@ -119,7 +121,7 @@ def determine_setup(
|
|||
) -> Tuple[py.path.local, Optional[str], Any]:
|
||||
dirs = get_dirs_from_args(args)
|
||||
if inifile:
|
||||
iniconfig = py.iniconfig.IniConfig(inifile)
|
||||
iniconfig = IniConfig(inifile)
|
||||
is_cfg_file = str(inifile).endswith(".cfg")
|
||||
sections = ["tool:pytest", "pytest"] if is_cfg_file else ["pytest"]
|
||||
for section in sections:
|
||||
|
|
|
@ -22,6 +22,7 @@ from typing import Union
|
|||
from weakref import WeakKeyDictionary
|
||||
|
||||
import py
|
||||
from iniconfig import IniConfig
|
||||
|
||||
import pytest
|
||||
from _pytest._code import Source
|
||||
|
@ -683,7 +684,7 @@ class Testdir:
|
|||
def getinicfg(self, source):
|
||||
"""Return the pytest section from the tox.ini config file."""
|
||||
p = self.makeini(source)
|
||||
return py.iniconfig.IniConfig(p)["pytest"]
|
||||
return IniConfig(p)["pytest"]
|
||||
|
||||
def makepyfile(self, *args, **kwargs):
|
||||
r"""Shortcut for .makefile() with a .py extension.
|
||||
|
|
Loading…
Reference in New Issue