Tests that `dask.array.__all__` is correct
()
| 10 | |
| 11 | |
| 12 | def 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 |