def test_advantage_function_with_no_iterable(): operator = Advantage() with pytest.raises(TypeError): operator.function(None)
def test_advantage_function_when_choosing_from_empty_array(): operator = Advantage() with pytest.raises(IndexError): operator.function([])