deprecation module¶
Class |
Description |
---|---|
A warning class for deprecated methods |
|
A warning class for methods to be removed |
DeprecatedWarning¶
- class DeprecatedWarning[source]¶
Bases:
DeprecationWarning
A warning class for deprecated methods
This is a specialization of the built-in
DeprecationWarning
, adding parameters that allow us to get information into the __str__ that ends up being sent through thewarnings
system. The attributes aren’t able to be retrieved after the warning gets raised and passed through the system as only the class–not the instance–and message are what gets preserved.- Parameters:
function – The function being deprecated.
deprecated_in – The version that
function
is deprecated inremoved_in – The version or
datetime.date
specifying whenfunction
gets removed.details – Optional details about the deprecation. Most often this will include directions on what to use instead of the now deprecated code.
UnsupportedWarning¶
- class UnsupportedWarning[source]¶
Bases:
DeprecatedWarning
A warning class for methods to be removed
This is a subclass of
DeprecatedWarning
and is used to output a proper message about a function being unsupported. Additionally, thefail_if_not_removed
decorator will handle this warning and cause any tests to fail if the system under test uses code that raises this warning.