skimage 0.17.2

BackRef
all_warnings()

Context for use in testing to ensure that all warnings are raised.

Examples

This example is valid syntax, but we were not able to check execution
>>> import warnings
... def foo():
...  warnings.warn(RuntimeWarning("bar"), stacklevel=2)

We raise the warning once, while the warning filter is set to "once". Hereafter, the warning is invisible, even with custom filters:

This example is valid syntax, but we were not able to check execution
>>> with warnings.catch_warnings():
...  warnings.simplefilter('once')
...  foo() # doctest: +SKIP

We can now run foo() without a warning being raised:

This example is valid syntax, but we were not able to check execution
>>> from numpy.testing import assert_warns
... foo() # doctest: +SKIP

To catch the warning, we call in the help of all_warnings :

This example is valid syntax, but we were not able to check execution
>>> with all_warnings():
...  assert_warns(RuntimeWarning, foo)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage._shared._warnings.all_warnings skimage._shared._warnings.expected_warnings

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/_shared/_warnings.py#16
type: <class 'function'>
Commit: