Skip to content

Commit 3405966

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2d991b5 commit 3405966

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: src/_pytest/python.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
from _pytest.scope import _ScopeName
7070
from _pytest.scope import Scope
7171
from _pytest.stash import StashKey
72-
from _pytest.warning_types import PytestCollectionWarning, PytestDefaultArgumentWarning, warn_explicit_for
72+
from _pytest.warning_types import PytestCollectionWarning
73+
from _pytest.warning_types import PytestDefaultArgumentWarning
7374

7475

7576
if TYPE_CHECKING:
@@ -145,12 +146,18 @@ def async_fail(nodeid: str) -> None:
145146

146147
def async_default_arg_warn(nodeid: str, function_name, param) -> None:
147148
msg = (
148-
"Test function '" + function_name + "' has a default argument '" + param.name + "=" + str(param.default) + "'.\n"
149+
"Test function '"
150+
+ function_name
151+
+ "' has a default argument '"
152+
+ param.name
153+
+ "="
154+
+ str(param.default)
155+
+ "'.\n"
149156
)
150157
warnings.simplefilter("always", PytestDefaultArgumentWarning)
151158
warnings.warn(PytestDefaultArgumentWarning(msg))
152159

153-
160+
154161
@hookimpl(trylast=True)
155162
def pytest_pyfunc_call(pyfuncitem: Function) -> object | None:
156163
testfunction = pyfuncitem.obj

Diff for: src/_pytest/warning_types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class PytestCollectionWarning(PytestWarning):
4747
@final
4848
class PytestDefaultArgumentWarning(PytestWarning):
4949
"""Warning emitted when a test function has default arguments."""
50-
50+
5151
__module__ = "pytest"
5252

5353

0 commit comments

Comments
 (0)