Nitpick: I'd write this test to be a bit more explicit:
```
for ext in [0, 1, 3]:
   ...  # keep doing what you're doing

# handle ext=3 separately
assert_raises(ValueError, lut, x, y, **dict(k=1, ext=3))
```