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

Method test_calls_before_prepare

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

Source from the content-addressed store, hash-verified

128 self._assert_cycle({1: {2}, 2: {3}, 3: {2, 4}, 4: {5}}, [3, 2])
129
130 def test_calls_before_prepare(self):
131 ts = graphlib.TopologicalSorter()
132
133 with self.assertRaisesRegex(ValueError, r"prepare\(\) must be called first"):
134 ts.get_ready()
135 with self.assertRaisesRegex(ValueError, r"prepare\(\) must be called first"):
136 ts.done(3)
137 with self.assertRaisesRegex(ValueError, r"prepare\(\) must be called first"):
138 ts.is_active()
139
140 def test_prepare_multiple_times(self):
141 ts = graphlib.TopologicalSorter()

Callers

nothing calls this directly

Calls 4

get_readyMethod · 0.95
doneMethod · 0.95
is_activeMethod · 0.95
assertRaisesRegexMethod · 0.80

Tested by

no test coverage detected