From 8ec2a1508aceed7183300abac084b47d54712cde Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 19 Dec 2023 19:05:45 +0100 Subject: [PATCH] test: Fix `FATAL: sorry, too many clients already` When disposing the SQLAlchemy engine object after use, the error goes away. --- target_postgres/tests/test_target_postgres.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target_postgres/tests/test_target_postgres.py b/target_postgres/tests/test_target_postgres.py index ab4cd11d..f676f8f1 100644 --- a/target_postgres/tests/test_target_postgres.py +++ b/target_postgres/tests/test_target_postgres.py @@ -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( @@ -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):