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

Function test__check_warning

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

Source from the content-addressed store, hash-verified

37
38
39def test__check_warning():
40 class MyWarning(Warning):
41 pass
42
43 with warnings.catch_warnings():
44 warnings.simplefilter("error")
45 with _check_warning(True, MyWarning, "foo"):
46 warnings.warn("foo", MyWarning)
47
48 with pytest.warns(MyWarning, match="foo"):
49 with _check_warning(False, MyWarning, "foo"):
50 warnings.warn("foo", MyWarning)

Callers

nothing calls this directly

Calls 1

_check_warningFunction · 0.90

Tested by

no test coverage detected