def test_with_out_of_range_index(self): with pytest.raises(IndexError): assert index(11, 10)
def test_with_negative_index(self): assert index(-2, 10) == 8
def test_with_index_inrange(self): assert index(2, 10) == 2