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

Function test_api

dask/array/tests/test_api.py:12–32  ·  view source on GitHub ↗

Tests that `dask.array.__all__` is correct

()

Source from the content-addressed store, hash-verified

10
11
12def test_api():
13 """Tests that `dask.array.__all__` is correct"""
14 import dask.array as da
15
16 member_dict = vars(da)
17 members = set(member_dict)
18 # unexported submodules
19 members -= {"tests"}
20 members -= {
21 m
22 for m, mod in member_dict.items()
23 if m not in DA_EXPORTED_SUBMODULES
24 if isinstance(mod, ModuleType) and mod.__spec__.parent == "dask.array"
25 }
26 # imported utility modules
27 members -= {"annotations", "builtins", "importlib", "warnings"}
28 # private utilities and `__dunder__` members
29 members -= {"ARRAY_EXPR_ENABLED"}
30 members -= {m for m in members if m.startswith("_")}
31
32 assert set(da.__all__) == members

Callers

nothing calls this directly

Calls 2

setClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected