def test_specialize_on_missing_names(): with pytest.raises(ValueError): f = specialize_on('k')(for_specialize)
def test_specialize_on(names): f = specialize_on(names)(for_specialize) assert f(1, 2) == for_specialize(1, 2) assert f(1, 2, d=10) == for_specialize(1, 2, d=10) assert f(a=3, b=4, d=2) == for_specialize(a=3, b=4, d=2)