(self)
| 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 |
nothing calls this directly
no test coverage detected