Skip to content

Commit 61c9285

Browse files
Improve test
1 parent b6f4db4 commit 61c9285

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_heapq.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def test_heappop_mutating_heap(self):
508508
with self.assertRaises((IndexError, RuntimeError)):
509509
self.module.heappop_max(heap)
510510

511-
def test_comparison_operator_modifiying_heap(self):
511+
def test_comparison_operator_modifying_heap(self):
512512
# See bpo-39421: Strong references need to be taken
513513
# when comparing objects as they can alter the heap
514514
class EvilClass(int):
@@ -526,7 +526,7 @@ def __gt__(self, o):
526526
self.module.heappush_max(heap, EvilClass(1))
527527
self.assertRaises(IndexError, self.module.heappushpop_max, heap, 0)
528528

529-
def test_comparison_operator_modifiying_heap_two_heaps(self):
529+
def test_comparison_operator_modifying_heap_two_heaps(self):
530530

531531
class h(int):
532532
def __lt__(self, o):
@@ -553,8 +553,8 @@ def __lt__(self, o):
553553
self.module.heappush_max(list1, g(1))
554554
self.module.heappush_max(list2, h(1))
555555

556-
TestHeap.check_max_invariant(self, list1)
557-
TestHeap.check_max_invariant(self, list2)
556+
self.assertRaises((IndexError, RuntimeError), self.module.heappush_max, list1, g(1))
557+
self.assertRaises((IndexError, RuntimeError), self.module.heappush_max, list2, h(1))
558558

559559

560560
class TestErrorHandlingPython(TestErrorHandling, TestCase):

0 commit comments

Comments
 (0)