In addition to using `pytest.raises` instead of `catch_warnings`, it would be necessary to import `FitsScaleError` into this module's namespace.

An alternative, albeit a bit tricky, is that since `FitsScaleError` is already a `ValueError` subclass you could just do:

```
with pytest.raises(ValueError) as exc:
    assert exc.__class__.__name__ == 'FitsScaleError`
```

a little more roundabout but still fine as far as I'm concerned, and saves you the import.