Skip to content
This repository was archived by the owner on Nov 1, 2022. It is now read-only.

Commit 4107389

Browse files
committed
Add more assertions on dep tree
1 parent b1caeae commit 4107389

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/unit/test_import.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@ def test_import_layer_does_not_import_heavy_libs():
1010
_, raw_output = get_import_time(import_cmd="layer", module_only=True)
1111
all_imports = prune_import_depth(parse_import_time(raw_output), depth=4)
1212

13-
deps = import_tree_to_waterfall(all_imports, width=64)
13+
assert len(all_imports) > 0
14+
assert all_imports[0].name == "root"
15+
assert "layer" in {nested.name for nested in all_imports[0].nested_imports}
1416

17+
deps = import_tree_to_waterfall(all_imports, width=64)
1518
assert "torch" not in deps
1619
assert "xgboost" not in deps
1720
assert "keras" not in deps

0 commit comments

Comments
 (0)