Skip to content

Commit

Permalink
fix: unclosed socket warning in db containers (testcontainers#378)
Browse files Browse the repository at this point in the history
This PR fixes testcontainers#379
  • Loading branch information
sha1n authored Mar 9, 2024
1 parent 902a5a3 commit cd90aa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/testcontainers/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def _connect(self) -> None:
import sqlalchemy

engine = sqlalchemy.create_engine(self.get_connection_url())
engine.connect()
try:
engine.connect()
finally:
engine.dispose()

def get_connection_url(self) -> str:
raise NotImplementedError
Expand Down

0 comments on commit cd90aa7

Please sign in to comment.