Skip to content

Commit bda322a

Browse files
committed
config: remove unneeded lazy imports
And a couple of minor cleanups.
1 parent 3b4071e commit bda322a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/_pytest/config/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,9 +1041,6 @@ def __init__(
10411041
*,
10421042
invocation_params: InvocationParams | None = None,
10431043
) -> None:
1044-
from .argparsing import FILE_OR_DIR
1045-
from .argparsing import Parser
1046-
10471044
if invocation_params is None:
10481045
invocation_params = self.InvocationParams(
10491046
args=(), plugins=None, dir=pathlib.Path.cwd()
@@ -1061,9 +1058,8 @@ def __init__(
10611058
:type: InvocationParams
10621059
"""
10631060

1064-
_a = FILE_OR_DIR
10651061
self._parser = Parser(
1066-
usage=f"%(prog)s [options] [{_a}] [{_a}] [...]",
1062+
usage=f"%(prog)s [options] [{FILE_OR_DIR}] [{FILE_OR_DIR}] [...]",
10671063
processopt=self._processopt,
10681064
_ispytest=True,
10691065
)

src/_pytest/config/argparsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from typing import Literal
1313
from typing import NoReturn
1414

15+
from .exceptions import UsageError
1516
import _pytest._io
16-
from _pytest.config.exceptions import UsageError
1717
from _pytest.deprecated import check_ispytest
1818

1919

0 commit comments

Comments
 (0)