File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 69
69
from _pytest .scope import _ScopeName
70
70
from _pytest .scope import Scope
71
71
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
73
74
74
75
75
76
if TYPE_CHECKING :
@@ -145,12 +146,18 @@ def async_fail(nodeid: str) -> None:
145
146
146
147
def async_default_arg_warn (nodeid : str , function_name , param ) -> None :
147
148
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 "
149
156
)
150
157
warnings .simplefilter ("always" , PytestDefaultArgumentWarning )
151
158
warnings .warn (PytestDefaultArgumentWarning (msg ))
152
159
153
-
160
+
154
161
@hookimpl (trylast = True )
155
162
def pytest_pyfunc_call (pyfuncitem : Function ) -> object | None :
156
163
testfunction = pyfuncitem .obj
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class PytestCollectionWarning(PytestWarning):
47
47
@final
48
48
class PytestDefaultArgumentWarning (PytestWarning ):
49
49
"""Warning emitted when a test function has default arguments."""
50
-
50
+
51
51
__module__ = "pytest"
52
52
53
53
You can’t perform that action at this time.
0 commit comments