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

Method test_heappushpop_max

Lib/test/test_heapq.py:262–279  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 self.assertEqual((h, x), ([11], 10))
261
262 def test_heappushpop_max(self):
263 h = []
264 x = self.module.heappushpop_max(h, 10)
265 self.assertTupleEqual((h, x), ([], 10))
266
267 h = [10]
268 x = self.module.heappushpop_max(h, 10.0)
269 self.assertTupleEqual((h, x), ([10], 10.0))
270 self.assertIsInstance(h[0], int)
271 self.assertIsInstance(x, float)
272
273 h = [10]
274 x = self.module.heappushpop_max(h, 11)
275 self.assertTupleEqual((h, x), ([10], 11))
276
277 h = [10]
278 x = self.module.heappushpop_max(h, 9)
279 self.assertTupleEqual((h, x), ([9], 10))
280
281 def test_heappop_max(self):
282 # heapop_max has an optimization for one-item lists which isn't

Callers

nothing calls this directly

Calls 2

assertTupleEqualMethod · 0.80
assertIsInstanceMethod · 0.80

Tested by

no test coverage detected