diff --git a/tests/conftest.py b/tests/conftest.py index 2969f47..2973e33 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -64,7 +64,7 @@ def load_schema_db(schema): os.makedirs(bijoe_schema_dir) try: - with closing(psycopg2.connect('')) as conn: + with closing(psycopg2.connect(user=os.environ.get('USER'), dbname='postgres')) as conn: conn.set_isolation_level(0) with conn.cursor() as cursor: cursor.execute('CREATE DATABASE %s' % database_name) @@ -114,7 +114,7 @@ def load_schema_db(schema): d['tables'] = json.load(f) yield d finally: - with closing(psycopg2.connect('')) as conn: + with closing(psycopg2.connect(user=os.environ.get('USER'), dbname='postgres')) as conn: conn.set_isolation_level(0) with conn.cursor() as cursor: cursor.execute('DROP DATABASE IF EXISTS %s' % database_name)