MCPcopy Create free account
hub / github.com/dask/dask / test__check_warning

Function test__check_warning

dask/tests/test_utils_test.py:57–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def test__check_warning():
58 class MyWarning(Warning):
59 pass
60
61 with warnings.catch_warnings():
62 warnings.simplefilter("error")
63 with _check_warning(True, MyWarning, "foo"):
64 warnings.warn("foo", MyWarning)
65
66 with pytest.warns(MyWarning, match="foo"):
67 with _check_warning(False, MyWarning, "foo"):
68 warnings.warn("foo", MyWarning)

Callers

nothing calls this directly

Calls 1

_check_warningFunction · 0.90

Tested by

no test coverage detected