Skip to content

Commit fdb9926

Browse files
committed
modify lint
1 parent 8733134 commit fdb9926

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

eventsourcingdb/container.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,28 @@ def start(self) -> 'Container':
139139
def _pull_or_get_image(self) -> None:
140140
"""Pull Docker image or use local image if pulling fails."""
141141
image_name = f"{self._image_name}:{self._image_tag}"
142-
142+
143143
# First check if the image is already available locally
144144
try:
145145
self._docker_client.images.get(image_name)
146-
logging.info("Using locally available image: %s", image_name)
147-
return
148146
except errors.ImageNotFound:
149147
logging.info("Image not found locally, attempting to pull: %s", image_name)
150-
148+
else:
149+
logging.info("Using locally available image: %s", image_name)
150+
return
151+
151152
# Try to pull the image
152153
try:
153154
# Pull image with default timeout settings
154155
self._docker_client.api.pull(
155156
self._image_name,
156-
tag=self._image_tag
157-
)
157+
tag=self._image_tag)
158158
except (
159-
errors.APIError,
159+
errors.APIError,
160160
requests.exceptions.Timeout,
161161
requests.exceptions.ConnectionError
162162
) as e:
163-
# Try to use locally cached image as fallback
163+
# pylint: disable=W0717
164164
try:
165165
self._docker_client.images.get(image_name)
166166
logging.warning(

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import logging
12
import pytest
23
import pytest_asyncio
34
from eventsourcingdb import EventCandidate
45
from .shared.database import Database
5-
import logging
66

77

88
@pytest_asyncio.fixture
@@ -16,7 +16,7 @@ async def database():
1616
logging.error("Failed to create database container: %s", e)
1717
pytest.skip(f"Skipping test due to database container initialization failure: {e}")
1818
finally:
19-
if 'testing_db' in locals() and testing_db is not None:
19+
if testing_db in locals() and testing_db is not None:
2020
await testing_db.stop()
2121

2222

0 commit comments

Comments
 (0)