Skip to content

Commit aebc6ef

Browse files
committed
Enable ruff TCH checks in more files
1 parent 12117fa commit aebc6ef

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

src/vws/exceptions/base_exceptions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
Cloud Recognition Web API.
44
"""
55

6-
from requests import Response
6+
from __future__ import annotations
7+
8+
from typing import TYPE_CHECKING
9+
10+
if TYPE_CHECKING:
11+
from requests import Response
712

813

914
class CloudRecoException(Exception):

tests/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
Configuration, plugins and fixtures for `pytest`.
33
"""
44

5-
from collections.abc import Iterator
5+
from __future__ import annotations
6+
7+
from typing import TYPE_CHECKING
68

79
import pytest
810
from mock_vws import MockVWS
911
from mock_vws.database import VuforiaDatabase
1012
from vws import VWS, CloudRecoService
1113

14+
if TYPE_CHECKING:
15+
from collections.abc import Iterator
16+
1217

1318
@pytest.fixture(name="_mock_database")
1419
def mock_database() -> Iterator[VuforiaDatabase]:

tests/test_cloud_reco_exceptions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
Tests for exceptions raised when using the CloudRecoService.
33
"""
44

5-
import io
5+
from __future__ import annotations
6+
67
import time
78
import uuid
89
from http import HTTPStatus
10+
from typing import TYPE_CHECKING
911

1012
import pytest
1113
from mock_vws import MockVWS
@@ -25,6 +27,9 @@
2527
RequestEntityTooLarge,
2628
)
2729

30+
if TYPE_CHECKING:
31+
import io
32+
2833

2934
def test_too_many_max_results(
3035
cloud_reco_client: CloudRecoService,

tests/test_query.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22
Tests for the ``CloudRecoService`` querying functionality.
33
"""
44

5-
import io
5+
from __future__ import annotations
6+
67
import uuid
8+
from typing import TYPE_CHECKING
79

810
from mock_vws import MockVWS
911
from mock_vws.database import VuforiaDatabase
1012
from vws import VWS, CloudRecoService
1113
from vws.include_target_data import CloudRecoIncludeTargetData
1214

15+
if TYPE_CHECKING:
16+
import io
17+
1318

1419
class TestQuery:
1520
"""

0 commit comments

Comments
 (0)