def test_heap_post_push_unorderable_not_broken(self): heap = Heap([1, 2, 3]) try: heap.push([]) except ValueError: pass else: pass for x in popper(heap): pass # this should run fine and not see that list or Python 2 won't care
def test_heap_complain_unorderable(self): if sys.version_info < (3,): raise unittest.SkipTest("Python 2 happily compares disparate types.") heap = Heap([1, 2, 3]) try: heap.push([]) except ValueError as e: self.assertIn("order", str(e)) else: self.fail("allowed insertion of unorderable type")
def test_heap_complain_unorderable(self): if sys.version_info < (3, ): raise unittest.SkipTest( "Python 2 happily compares disparate types.") heap = Heap([1, 2, 3]) try: heap.push([]) except ValueError as e: self.assertIn("order", str(e)) else: self.fail("allowed insertion of unorderable type")