From f87e1b30fc24374d6d8a33f9ca97f80db726d358 Mon Sep 17 00:00:00 2001 From: tarsil Date: Mon, 27 Mar 2023 19:03:06 +0100 Subject: [PATCH] Fix typo in tests and missing comma in CI --- .github/workflows/test-suite.yml | 20 +++++++++++++------- tests/test_databases.py | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9db42247..9c8f2fea 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -41,11 +41,17 @@ jobs: mssql: image: mcr.microsoft.com/mssql/server:2019-GA-ubuntu-16.04 env: - MSSQL_SA_PASSWORD: "mssql123mssql" + MSSQL_SA_PASSWORD: "Mssql123$#mssql" ACCEPT_EULA: "Y" - MSSQL_PID: "Developer" + MSSQL_PID: Express ports: - - "1433:1433" + - 1433/tcp + options: >- + --health-cmd "/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -Q 'select 1' -b -o /dev/null" + --health-interval 60s + --health-timeout 30s + --health-start-period 20s + --health-retries 3 steps: - uses: "actions/checkout@v3" @@ -73,8 +79,8 @@ jobs: mysql+asyncmy://username:password@localhost:3306/testsuite, postgresql://username:password@localhost:5432/testsuite, postgresql+aiopg://username:password@127.0.0.1:5432/testsuite, - postgresql+asyncpg://username:password@localhost:5432/testsuite - mssql://sa:mssql123mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server, - mssql+pyodbc://sa:mssql123mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server, - mssql+aioodbc://sa:mssql123mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server + postgresql+asyncpg://username:password@localhost:5432/testsuite, + mssql://sa:Mssql123$#mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server, + mssql+pyodbc://sa:Mssql123$#mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server, + mssql+aioodbc://sa:Mssql123$#mssql@localhost:1433/master?driver=ODBC+Driver+17+for+SQL+Server run: "scripts/test" diff --git a/tests/test_databases.py b/tests/test_databases.py index a64fac08..fb7d0ead 100644 --- a/tests/test_databases.py +++ b/tests/test_databases.py @@ -934,7 +934,7 @@ async def test_queries_with_expose_backend_connection(database_url): cursor = await raw_connection.cursor() await cursor.execute(select_query) results = await cursor.fetchall() - elif database.url.scheme == "mysql+asyncmy" or data: + elif database.url.scheme == "mysql+asyncmy": async with raw_connection.cursor() as cursor: await cursor.execute(select_query) results = await cursor.fetchall()