Skip to content

Commit

Permalink
Rollback testcontainers version
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenchrist committed Apr 24, 2024
1 parent a7826e7 commit c5ac670
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
15 changes: 10 additions & 5 deletions tests/test_test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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),
)
Expand Down

0 comments on commit c5ac670

Please sign in to comment.