diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2022-07-04 15:15:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-04 15:15:33 +0100 |
commit | 9820665597ab6a3bbb1d23d0824752967b2170dd (patch) | |
tree | cb64a00ce4cdc004802da8fca908b093afd1fb41 | |
parent | [Complement] Allow device_name lookup over federation (#13167) (diff) | |
download | synapse-9820665597ab6a3bbb1d23d0824752967b2170dd.tar.xz |
Remove tests/utils.py from mypy's exclude list (#13159)
-rw-r--r-- | changelog.d/13159.misc | 1 | ||||
-rw-r--r-- | mypy.ini | 1 | ||||
-rw-r--r-- | tests/server.py | 1 | ||||
-rw-r--r-- | tests/utils.py | 4 |
4 files changed, 3 insertions, 4 deletions
diff --git a/changelog.d/13159.misc b/changelog.d/13159.misc new file mode 100644 index 0000000000..bb5554ebe0 --- /dev/null +++ b/changelog.d/13159.misc @@ -0,0 +1 @@ +Improve and fix type hints. \ No newline at end of file diff --git a/mypy.ini b/mypy.ini index b9b16860db..d757a88fd1 100644 --- a/mypy.ini +++ b/mypy.ini @@ -73,7 +73,6 @@ exclude = (?x) |tests/util/test_lrucache.py |tests/util/test_rwlock.py |tests/util/test_wheel_timer.py - |tests/utils.py )$ [mypy-synapse.federation.transport.client] diff --git a/tests/server.py b/tests/server.py index b9f465971f..ce017ca0f6 100644 --- a/tests/server.py +++ b/tests/server.py @@ -830,7 +830,6 @@ def setup_test_homeserver( # Mock TLS hs.tls_server_context_factory = Mock() - hs.tls_client_options_factory = Mock() hs.setup() if homeserver_to_use == TestHomeServer: 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() |