()
| 23 | |
| 24 | |
| 25 | def test_cull(): |
| 26 | # 'out' depends on 'x' and 'y', but not 'z' |
| 27 | d = {"x": 1, "y": (inc, "x"), "z": (inc, "x"), "out": (add, "y", 10)} |
| 28 | culled, dependencies = cull(d, "out") |
| 29 | assert culled == {"x": 1, "y": (inc, "x"), "out": (add, "y", 10)} |
| 30 | assert dependencies == {"x": [], "y": ["x"], "out": ["y"]} |
| 31 | |
| 32 | assert cull(d, "out") == cull(d, ["out"]) |
| 33 | assert cull(d, ["out", "z"])[0] == d |
| 34 | assert cull(d, [["out"], ["z"]]) == cull(d, ["out", "z"]) |
| 35 | pytest.raises(KeyError, lambda: cull(d, "badkey")) |
| 36 | |
| 37 | |
| 38 | def fuse2(*args, **kwargs): |
nothing calls this directly
no test coverage detected
searching dependent graphs…