What's the problem this feature will solve?
When implementing deprecated features, we are regularly expected to use the DeprecationWarning and PendingDeprecationWarning warnings. However, there is another one: FutureWarning. This particular warning is used by packages such as pydeprecate as the default warning for any functions that will be removed in the future.
However, when I write a function that raises the FutureWarning (or use the @deprecated decorator), then deprecated_call() currently does not catch the test successfully.
Describe the solution you'd like
I'd like to add FutureWarning to the list of warnings which are captured by deprecated_call().
This is the current behaviour:
from warnings import warn
from pytest import deprecated_call
def deprecated_func():
warn("This function is deprecated", DeprecationWarning)
pass
def future_deprecation_func():
warn("This function will be deprecated in the future", FutureWarning)
pass
def test_deprecated():
"""Expected to pass"""
with deprecated_call():
deprecated_func()
def test_futures():
"""Expected to fail"""
with deprecated_call():
future_deprecation_func()
The expected behaviour would be for both of these two test cases to pass successfully.
Alternative Solutions
N/A
Additional context
N/A
What's the problem this feature will solve?
When implementing deprecated features, we are regularly expected to use the
DeprecationWarningandPendingDeprecationWarningwarnings. However, there is another one:FutureWarning. This particular warning is used by packages such aspydeprecateas the default warning for any functions that will be removed in the future.However, when I write a function that raises the
FutureWarning(or use the@deprecateddecorator), thendeprecated_call()currently does not catch the test successfully.Describe the solution you'd like
I'd like to add
FutureWarningto the list of warnings which are captured bydeprecated_call().This is the current behaviour:
The expected behaviour would be for both of these two test cases to pass successfully.
Alternative Solutions
N/A
Additional context
N/A