suppress_warnings.filter(category=<type 'exceptions.Warning'>, message='', module=None)[源代码]

Add a new suppressing filter or apply it if the state is entered.

category : class, optional

Warning class to filter

message : string, optional

Regular expression matching the warning message.

module : module, optional

Module to filter for. Note that the module (and its file) must match exactly and cannot be a submodule. This may make it unreliable for external modules.


When added within a context, filters are only added inside the context and will be forgotten when the context is exited.