def test_pop(): slt = SortedList(range(10)) slt._reset(4) slt._check() assert slt.pop() == 9 slt._check() assert slt.pop(0) == 0 slt._check() assert slt.pop(-2) == 7 slt._check() assert slt.pop(4) == 5 slt._check()
def test_pop_indexerror3(): slt = SortedList() with pytest.raises(IndexError): slt.pop()
def test_pop_indexerror2(): slt = SortedList(range(10)) slt._reset(4) with pytest.raises(IndexError): slt.pop(10)