Skip to content

Commit 0c414e8

Browse files
committed
Enable Ruff check PLR0915
1 parent 743b8a9 commit 0c414e8

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ ignore = [
218218
# Ignore "too-many-*" errors as they seem to get in the way more than
219219
# helping.
220220
"PLR0913",
221-
"PLR0915",
222221
# Allow 'assert' in tests as it is the standard for pytest.
223222
# Also, allow 'assert' in other code as it is the standard for Python type hint
224223
# narrowing - see

tests/mock_vws/test_docker.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import requests
1414
from docker.errors import BuildError, NotFound # type: ignore[import-untyped]
1515
from docker.models.containers import Container # type: ignore[import-untyped]
16-
from docker.models.networks import Network # type: ignore[import-untyped]
1716
from mock_vws.database import VuforiaDatabase
1817
from tenacity import retry
1918
from tenacity.retry import retry_if_exception_type
@@ -26,6 +25,7 @@
2625
from collections.abc import Iterator
2726

2827
from docker.models.images import Image # type: ignore[import-untyped]
28+
from docker.models.networks import Network # type: ignore[import-untyped]
2929

3030

3131
# We do not cover this function because hitting particular branches depends on
@@ -81,7 +81,6 @@ def fixture_custom_bridge_network() -> Iterator[Network]:
8181
driver="nat",
8282
)
8383

84-
assert isinstance(network, Network)
8584
try:
8685
yield network
8786
finally:
@@ -138,8 +137,9 @@ def test_build_and_run(
138137
"no matching manifest for windows/amd64" not in exc.msg
139138
): # pragma: no cover
140139
raise AssertionError(full_log) from exc
141-
reason = "We do not currently support using Windows containers."
142-
pytest.skip(reason)
140+
pytest.skip(
141+
reason="We do not currently support using Windows containers."
142+
)
143143

144144
vwq_image, _ = client.images.build(
145145
path=str(repository_root),
@@ -191,13 +191,9 @@ def test_build_and_run(
191191
},
192192
)
193193

194-
assert isinstance(target_manager_container, Container)
195-
assert isinstance(vws_container, Container)
196-
assert isinstance(vwq_container, Container)
197194
for container in (target_manager_container, vws_container, vwq_container):
198195
container.reload()
199196

200-
assert isinstance(target_manager_container.attrs, dict)
201197
target_manager_port_attrs = target_manager_container.attrs[
202198
"NetworkSettings"
203199
]["Ports"]
@@ -209,12 +205,10 @@ def test_build_and_run(
209205
"HostPort"
210206
]
211207

212-
assert isinstance(vws_container.attrs, dict)
213208
vws_port_attrs = vws_container.attrs["NetworkSettings"]["Ports"]
214209
vws_host_ip = vws_port_attrs["5000/tcp"][0]["HostIp"]
215210
vws_host_port = vws_port_attrs["5000/tcp"][0]["HostPort"]
216211

217-
assert isinstance(vwq_container.attrs, dict)
218212
vwq_port_attrs = vwq_container.attrs["NetworkSettings"]["Ports"]
219213
vwq_host_ip = vwq_port_attrs["5000/tcp"][0]["HostIp"]
220214
vwq_host_port = vwq_port_attrs["5000/tcp"][0]["HostPort"]

0 commit comments

Comments
 (0)