File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 27
27
else :
28
28
29
29
def deprecated (reason : str = "" ) -> object :
30
- raise AssertionError (
31
- "This decorator should only be used to indicate that overloads are deprecated"
32
- )
33
- # once py<3.13 is no longer supported, or when somebody wants to use decorators
34
- # to deprecated, we can consider adapting this function to raise warnings
35
- # at runtime
30
+ # This decorator should only be used to indicate that overloads are deprecated
31
+ # once py<3.13 is no longer supported, or when somebody wants to use @deprecated
32
+ # for runtime warning, we can consider adapting this decorator to support that
33
+ def decorator (func : object ) -> object :
34
+ return func
35
+
36
+ return decorator
36
37
37
38
38
39
CALLABLE_RAISES = PytestPendingDeprecationWarning (
Original file line number Diff line number Diff line change @@ -164,8 +164,11 @@ def test_deprecated_call_ret(self) -> None:
164
164
PytestPendingDeprecationWarning ,
165
165
match = (
166
166
wrap_escape (
167
- "The callable form of pytest.deprecated_call is deprecated.\n "
167
+ "The callable form of pytest.deprecated_call will be deprecated in a future version .\n "
168
168
"Use `with pytest.deprecated_call():` instead."
169
+ "Full deprecation will not be made until there's a tool to automatically update"
170
+ " code to use the context-manager form.\n "
171
+ "See https://docs.pytest.org/en/stable/reference/deprecations.html#legacy-callable-form-of-raises-warns-and-deprecated-call"
169
172
)
170
173
),
171
174
):
@@ -297,8 +300,11 @@ def test_function(self) -> None:
297
300
PytestPendingDeprecationWarning ,
298
301
match = (
299
302
wrap_escape (
300
- "The callable form of pytest.warns is deprecated.\n "
303
+ "The callable form of pytest.warns will be deprecated in a future version .\n "
301
304
"Use `with pytest.warns(...):` instead."
305
+ "Full deprecation will not be made until there's a tool to automatically update"
306
+ " code to use the context-manager form.\n "
307
+ "See https://docs.pytest.org/en/stable/reference/deprecations.html#legacy-callable-form-of-raises-warns-and-deprecated-call"
302
308
)
303
309
),
304
310
):
You can’t perform that action at this time.
0 commit comments