diff --git a/src/gotenberg_client/__init__.py b/src/gotenberg_client/__init__.py index 465635e..d1f211d 100644 --- a/src/gotenberg_client/__init__.py +++ b/src/gotenberg_client/__init__.py @@ -4,7 +4,15 @@ from gotenberg_client._client import GotenbergClient from gotenberg_client._errors import BaseClientError from gotenberg_client._errors import CannotExtractHereError +from gotenberg_client._errors import MaxRetriesExceededError from gotenberg_client.responses import SingleFileResponse from gotenberg_client.responses import ZipFileResponse -__all__ = ["GotenbergClient", "SingleFileResponse", "ZipFileResponse", "BaseClientError", "CannotExtractHereError"] +__all__ = [ + "GotenbergClient", + "SingleFileResponse", + "ZipFileResponse", + "BaseClientError", + "CannotExtractHereError", + "MaxRetriesExceededError", +] diff --git a/tests/test_misc_stuff.py b/tests/test_misc_stuff.py index c0e4034..c0cf69a 100644 --- a/tests/test_misc_stuff.py +++ b/tests/test_misc_stuff.py @@ -8,13 +8,13 @@ from pathlib import Path import pytest -from httpx import HTTPStatusError from httpx import Request from httpx import codes from pytest_httpx import HTTPXMock from gotenberg_client import CannotExtractHereError from gotenberg_client import GotenbergClient +from gotenberg_client import MaxRetriesExceededError from gotenberg_client import ZipFileResponse from tests.conftest import SAMPLE_DIR @@ -107,7 +107,7 @@ def test_server_error_retry(self, client: GotenbergClient, httpx_mock: HTTPXMock test_file = SAMPLE_DIR / "basic.html" with client.chromium.html_to_pdf() as route: - with pytest.raises(HTTPStatusError) as exc_info: + with pytest.raises(MaxRetriesExceededError) as exc_info: _ = route.index(test_file).run_with_retry(initial_retry_wait=0.1, retry_scale=0.1) assert exc_info.value.response.status_code == codes.SERVICE_UNAVAILABLE @@ -118,7 +118,7 @@ def test_not_a_server_error(self, client: GotenbergClient, httpx_mock: HTTPXMock test_file = SAMPLE_DIR / "basic.html" with client.chromium.html_to_pdf() as route: - with pytest.raises(HTTPStatusError) as exc_info: + with pytest.raises(MaxRetriesExceededError) as exc_info: _ = route.index(test_file).run_with_retry(initial_retry_wait=0.1, retry_scale=0.1) assert exc_info.value.response.status_code == codes.NOT_FOUND