Skip to content

Commit c02614d

Browse files
committed
fix: resolve linting issues in test_legacy_exceptions.py
1 parent cabc67d commit c02614d

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

tests/test_legacy_exceptions.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,31 @@
22

33
from __future__ import annotations
44

5-
import pytest
6-
75

86
def test_legacy_exception_imports():
97
"""Test that exceptions can be imported from replicate.exceptions."""
108
# Test importing individual exceptions from replicate.exceptions
9+
# All imports are intentionally kept to test that they can be imported
10+
# Test that imported exceptions are the same as the ones from replicate
11+
import replicate
1112
from replicate.exceptions import (
12-
APIConnectionError,
1313
APIError,
14-
APIResponseValidationError,
15-
APIStatusError,
16-
APITimeoutError,
17-
AuthenticationError,
18-
BadRequestError,
19-
ConflictError,
20-
InternalServerError,
2114
ModelError,
15+
ConflictError, # noqa: F401 # pyright: ignore[reportUnusedImport]
2216
NotFoundError,
23-
PermissionDeniedError,
17+
APIStatusError, # noqa: F401 # pyright: ignore[reportUnusedImport]
2418
RateLimitError,
2519
ReplicateError,
26-
UnprocessableEntityError,
20+
APITimeoutError,
21+
BadRequestError,
22+
APIConnectionError,
23+
AuthenticationError,
24+
InternalServerError,
25+
PermissionDeniedError, # noqa: F401 # pyright: ignore[reportUnusedImport]
26+
UnprocessableEntityError, # noqa: F401 # pyright: ignore[reportUnusedImport]
27+
APIResponseValidationError, # noqa: F401 # pyright: ignore[reportUnusedImport]
2728
)
2829

29-
# Test that imported exceptions are the same as the ones from replicate
30-
import replicate
31-
3230
assert ModelError is replicate._exceptions.ModelError
3331
assert APIError is replicate.APIError
3432
assert ReplicateError is replicate.ReplicateError

0 commit comments

Comments
 (0)