File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 6969from _pytest .scope import _ScopeName
7070from _pytest .scope import Scope
7171from _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
7576if TYPE_CHECKING :
@@ -145,12 +146,18 @@ def async_fail(nodeid: str) -> None:
145146
146147def 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 )
155162def pytest_pyfunc_call (pyfuncitem : Function ) -> object | None :
156163 testfunction = pyfuncitem .obj
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class PytestCollectionWarning(PytestWarning):
4747@final
4848class PytestDefaultArgumentWarning (PytestWarning ):
4949 """Warning emitted when a test function has default arguments."""
50-
50+
5151 __module__ = "pytest"
5252
5353
You can’t perform that action at this time.
0 commit comments