You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
match="The method 'case_no_version' requires a minimum Ansys release version of 24.2.0, but the current version used is 24.1.0 or lower.", # noqa: E501
267
271
):
268
272
case_no_version(mock_object)
273
+
274
+
275
+
deftest_deprecated_method_decorator():
276
+
"""Test the deprecated method decorator."""
277
+
278
+
classMockObject:
279
+
def__init__(self):
280
+
self._grpc_client=None
281
+
282
+
@staticmethod
283
+
@deprecated_method()
284
+
defdeprecated_method_no_input():
285
+
returnTrue
286
+
287
+
@staticmethod
288
+
@deprecated_method(info="This is some extra info.")
289
+
defdeprecated_method_with_info():
290
+
returnTrue
291
+
292
+
@staticmethod
293
+
@deprecated_method(info="This is some extra info.", alternative="new_method")
294
+
defdeprecated_method_with_info_and_alternate():
295
+
returnTrue
296
+
297
+
mock_object=MockObject()
298
+
299
+
# Ensure that the method is deprecated
300
+
withpytest.deprecated_call(match="The method 'deprecated_method_no_input' is deprecated."):
301
+
mock_object.deprecated_method_no_input()
302
+
303
+
withpytest.deprecated_call(
304
+
match="The method 'deprecated_method_with_info' is deprecated. This is some extra info."
305
+
):
306
+
mock_object.deprecated_method_with_info()
307
+
308
+
withpytest.deprecated_call(
309
+
match="The method 'deprecated_method_with_info_and_alternate' is deprecated."
310
+
" Use 'new_method' instead. This is some extra info."
0 commit comments