File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5- import pytest
6-
75
86def 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
You can’t perform that action at this time.
0 commit comments