MCPcopy Index your code
hub / github.com/python/cpython / static_order_with_groups

Method static_order_with_groups

Lib/test/test_graphlib.py:9–15  ·  view source on GitHub ↗
(ts)

Source from the content-addressed store, hash-verified

7class TestTopologicalSort(unittest.TestCase):
8 def _test_graph(self, graph, expected):
9 def static_order_with_groups(ts):
10 ts.prepare()
11 while ts.is_active():
12 nodes = ts.get_ready()
13 for node in nodes:
14 ts.done(node)
15 yield tuple(sorted(nodes))
16
17 ts = graphlib.TopologicalSorter(graph)
18 self.assertEqual(list(static_order_with_groups(ts)), list(expected))

Callers

nothing calls this directly

Calls 4

get_readyMethod · 0.80
prepareMethod · 0.45
is_activeMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected