summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2022-07-04 15:15:33 +0100
committerGitHub <noreply@github.com>2022-07-04 15:15:33 +0100
commit9820665597ab6a3bbb1d23d0824752967b2170dd (patch)
treecb64a00ce4cdc004802da8fca908b093afd1fb41 /tests/utils.py
parent[Complement] Allow device_name lookup over federation (#13167) (diff)
downloadsynapse-9820665597ab6a3bbb1d23d0824752967b2170dd.tar.xz
Remove tests/utils.py from mypy's exclude list (#13159)
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/utils.py b/tests/utils.py
index cabb2c0dec..aca6a0083b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -64,7 +64,7 @@ def setupdb():
             password=POSTGRES_PASSWORD,
             dbname=POSTGRES_DBNAME_FOR_INITIAL_CREATE,
         )
-        db_conn.autocommit = True
+        db_engine.attempt_to_set_autocommit(db_conn, autocommit=True)
         cur = db_conn.cursor()
         cur.execute("DROP DATABASE IF EXISTS %s;" % (POSTGRES_BASE_DB,))
         cur.execute(
@@ -94,7 +94,7 @@ def setupdb():
                 password=POSTGRES_PASSWORD,
                 dbname=POSTGRES_DBNAME_FOR_INITIAL_CREATE,
             )
-            db_conn.autocommit = True
+            db_engine.attempt_to_set_autocommit(db_conn, autocommit=True)
             cur = db_conn.cursor()
             cur.execute("DROP DATABASE IF EXISTS %s;" % (POSTGRES_BASE_DB,))
             cur.close()