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

Method test_prepare_after_pass_out

Lib/test/test_graphlib.py:145–150  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 ts.prepare()
144
145 def test_prepare_after_pass_out(self):
146 ts = graphlib.TopologicalSorter({'a': 'bc'})
147 ts.prepare()
148 self.assertEqual(set(ts.get_ready()), {'b', 'c'})
149 with self.assertRaisesRegex(ValueError, r"cannot prepare\(\) after starting sort"):
150 ts.prepare()
151
152 def test_prepare_cycleerror_each_time(self):
153 ts = graphlib.TopologicalSorter({'a': 'b', 'b': 'a'})

Callers

nothing calls this directly

Calls 5

prepareMethod · 0.95
get_readyMethod · 0.95
setFunction · 0.85
assertRaisesRegexMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected