Use `RegressionFileNotFoundError` and `RegressionError` to raise errors in the doc mode tests instead of using `pytest.fail`.
Use
RegressionFileNotFoundErrorandRegressionErrorto raise errors in the doc mode tests instead of usingpytest.fail.