MCPcopy
hub / github.com/python/mypy / test_sorted_components

Method test_sorted_components

mypy/test/testgraph.py:111–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

109 return manager
110
111 def test_sorted_components(self) -> None:
112 manager = self._make_manager()
113 graph = {
114 "a": State.new_state("a", None, "import b, c", manager),
115 "d": State.new_state("d", None, "pass", manager),
116 "b": State.new_state("b", None, "import c", manager),
117 "c": State.new_state("c", None, "import b, d", manager),
118 "builtins": State.new_state("builtins", None, "", manager),
119 }
120 manager.parse_all(list(graph.values()))
121 res = [scc.mod_ids for scc in sorted_components(graph)]
122 assert_equal(res, [{"builtins"}, {"d"}, {"c", "b"}, {"a"}])
123
124 def test_order_ascc(self) -> None:
125 manager = self._make_manager()

Callers

nothing calls this directly

Calls 7

_make_managerMethod · 0.95
sorted_componentsFunction · 0.90
assert_equalFunction · 0.90
listClass · 0.85
new_stateMethod · 0.80
parse_allMethod · 0.80
valuesMethod · 0.80

Tested by

no test coverage detected