diff --git a/test/native/auth/test_scram-sha-256.py b/test/native/auth/test_scram-sha-256.py index 597931f..560795d 100644 --- a/test/native/auth/test_scram-sha-256.py +++ b/test/native/auth/test_scram-sha-256.py @@ -1,6 +1,6 @@ import pytest -from pg8000.native import Connection, InterfaceError +from pg8000.native import Connection, DatabaseError, InterfaceError # This requires a line in pg_hba.conf that requires scram-sha-256 for the # database scram_sha_256 @@ -10,6 +10,10 @@ @pytest.fixture def setup(con): + try: + con.run("CREATE DATABASE {DB}") + except DatabaseError: + pass con.run("ALTER SYSTEM SET ssl = off") con.run("SELECT pg_reload_conf()") yield