File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff line change 1+ import logging
12import pytest
23import pytest_asyncio
34from eventsourcingdb import EventCandidate
45from .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
You can’t perform that action at this time.
0 commit comments