From c5ac67098ff3d0fc9ecc99da9312e092aae4ecf4 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 24 Apr 2024 16:27:35 +0200 Subject: [PATCH] Rollback testcontainers version --- pyproject.toml | 7 ++++++- tests/test_test_postgres.py | 15 ++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6204b63c..abd5e2e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,10 +49,15 @@ dev = [ "pytest-xdist", # testcontainers 4.x have issues with Kafka on arm # https://github.com/testcontainers/testcontainers-python/issues/450 - "testcontainers~=4.4.0", + "testcontainers<4.0.0", "testcontainers-minio", "testcontainers-postgres", "testcontainers-kafka", +# https://github.com/testcontainers/testcontainers-python/issues/554 +# "testcontainers~=4.4.0", +# "testcontainers[minio]", +# "testcontainers[postgres]", +# "testcontainers[kafka]", ] [project.urls] diff --git a/tests/test_test_postgres.py b/tests/test_test_postgres.py index e4e03fd0..b45f9b2d 100644 --- a/tests/test_test_postgres.py +++ b/tests/test_test_postgres.py @@ -25,8 +25,10 @@ def remove_container(): def test_test_postgres(postgres_container, monkeypatch): - monkeypatch.setenv("DATACONTRACT_POSTGRES_USERNAME", postgres.username) - monkeypatch.setenv("DATACONTRACT_POSTGRES_PASSWORD", postgres.password) + monkeypatch.setenv("DATACONTRACT_POSTGRES_USERNAME", postgres.POSTGRES_USER) + monkeypatch.setenv("DATACONTRACT_POSTGRES_PASSWORD", postgres.POSTGRES_PASSWORD) + # monkeypatch.setenv("DATACONTRACT_POSTGRES_USERNAME", postgres.username) + # monkeypatch.setenv("DATACONTRACT_POSTGRES_PASSWORD", postgres.password) _init_sql() data_contract_str = _setup_datacontract() @@ -49,9 +51,12 @@ def _setup_datacontract(): def _init_sql(): connection = psycopg2.connect( - database=postgres.dbname, - user=postgres.username, - password=postgres.password, + database=postgres.POSTGRES_DB, + user=postgres.POSTGRES_USER, + password=postgres.POSTGRES_PASSWORD, + # database=postgres.dbname, + # user=postgres.username, + # password=postgres.password, host=postgres.get_container_host_ip(), port=postgres.get_exposed_port(5432), )