obspy.core.util.testing.WarningsCapture

class WarningsCapture[source]

Bases: object

Try hard to capture all warnings.

Aims to be a reliable drop-in replacement for built-in warnings.catch_warnings() context manager.

Based on pytest’s _DeprecatedCallContext context manager.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

WarningsCapture._warn(message, category=<class 'Warning'>, *args, **kwargs)[source]
WarningsCapture._warn_explicit(message, category, *args, **kwargs)[source]

Special Methods

WarningsCapture.__delattr__(name, /)

Implement delattr(self, name).

WarningsCapture.__dir__()

Default dir() implementation.

WarningsCapture.__enter__()[source]
WarningsCapture.__eq__(value, /)

Return self==value.

WarningsCapture.__exit__(exc_type, exc_val, exc_tb)[source]
WarningsCapture.__format__(format_spec, /)

Default object formatter.

WarningsCapture.__ge__(value, /)

Return self>=value.

WarningsCapture.__getattribute__(name, /)

Return getattr(self, name).

WarningsCapture.__getitem__(key)[source]
WarningsCapture.__gt__(value, /)

Return self>value.

WarningsCapture.__hash__()

Return hash(self).

WarningsCapture.__init__()
WarningsCapture.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

WarningsCapture.__le__(value, /)

Return self<=value.

WarningsCapture.__len__()[source]
WarningsCapture.__lt__(value, /)

Return self<value.

WarningsCapture.__ne__(value, /)

Return self!=value.

WarningsCapture.__new__(**kwargs)
WarningsCapture.__reduce__()

Helper for pickle.

WarningsCapture.__reduce_ex__(protocol, /)

Helper for pickle.

WarningsCapture.__repr__()

Return repr(self).

WarningsCapture.__setattr__(name, value, /)

Implement setattr(self, name, value).

WarningsCapture.__sizeof__()

Size of object in memory, in bytes.

WarningsCapture.__str__()

Return str(self).

WarningsCapture.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).