File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ Replaced ``py.iniconfig `` with `iniconfig <https://pypi.org/project/iniconfig/ >`__.
Original file line number Diff line number Diff line change 12
12
'colorama;sys_platform=="win32"' ,
13
13
"pluggy>=0.12,<1.0" ,
14
14
'importlib-metadata>=0.12;python_version<"3.8"' ,
15
+ "iniconfig" ,
15
16
]
16
17
17
18
Original file line number Diff line number Diff line change 6
6
from typing import Tuple
7
7
8
8
import py
9
+ from iniconfig import IniConfig
10
+ from iniconfig import ParseError
9
11
10
12
from .exceptions import UsageError
11
13
from _pytest .compat import TYPE_CHECKING
@@ -40,8 +42,8 @@ def getcfg(args, config=None):
40
42
p = base .join (inibasename )
41
43
if exists (p ):
42
44
try :
43
- iniconfig = py . iniconfig . IniConfig (p )
44
- except py . iniconfig . ParseError as exc :
45
+ iniconfig = IniConfig (p )
46
+ except ParseError as exc :
45
47
raise UsageError (str (exc ))
46
48
47
49
if (
@@ -119,7 +121,7 @@ def determine_setup(
119
121
) -> Tuple [py .path .local , Optional [str ], Any ]:
120
122
dirs = get_dirs_from_args (args )
121
123
if inifile :
122
- iniconfig = py . iniconfig . IniConfig (inifile )
124
+ iniconfig = IniConfig (inifile )
123
125
is_cfg_file = str (inifile ).endswith (".cfg" )
124
126
sections = ["tool:pytest" , "pytest" ] if is_cfg_file else ["pytest" ]
125
127
for section in sections :
Original file line number Diff line number Diff line change 21
21
from weakref import WeakKeyDictionary
22
22
23
23
import py
24
+ from iniconfig import IniConfig
24
25
25
26
import pytest
26
27
from _pytest import timing
@@ -683,7 +684,7 @@ def makeini(self, source):
683
684
def getinicfg (self , source ):
684
685
"""Return the pytest section from the tox.ini config file."""
685
686
p = self .makeini (source )
686
- return py . iniconfig . IniConfig (p )["pytest" ]
687
+ return IniConfig (p )["pytest" ]
687
688
688
689
def makepyfile (self , * args , ** kwargs ):
689
690
r"""Shortcut for .makefile() with a .py extension.
You can’t perform that action at this time.
0 commit comments