Skip to content

Commit

Permalink
test: Fix FATAL: sorry, too many clients already
Browse files Browse the repository at this point in the history
Dispose the SQLAlchemy engine object after use within test utility functions.
  • Loading branch information
amotl committed Dec 19, 2023
1 parent c0d4a89 commit 8b3ea4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions target_postgres/tests/test_target_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def verify_data(
sqlalchemy.text(f"SELECT COUNT(*) FROM {full_table_name}")
)
assert result.first()[0] == number_of_rows
engine.dispose()


def verify_schema(
Expand Down Expand Up @@ -169,6 +170,7 @@ def verify_schema(
f"Column '{column.name}' (with type '{column.type}') "
f"does not match expected type: {column_type_expected}"
)
engine.dispose()


def test_sqlalchemy_url_config(postgres_config_no_ssl):
Expand Down

0 comments on commit 8b3ea4f

Please sign in to comment.