Skip to content
Snippets Groups Projects
Unverified Commit 5905ba12 authored by David Robertson's avatar David Robertson Committed by GitHub
Browse files

Run trial tests against Python 3.11 (#13812)

parent 9473ebb9
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ IS_PR = os.environ["GITHUB_REF"].startswith("refs/pull/")
trial_sqlite_tests = [
{
"python-version": "3.7",
"python-version": "3.11",
"database": "sqlite",
"extras": "all",
}
......@@ -46,13 +46,13 @@ if not IS_PR:
"database": "sqlite",
"extras": "all",
}
for version in ("3.8", "3.9", "3.10")
for version in ("3.8", "3.9", "3.10", "3.11")
)
trial_postgres_tests = [
{
"python-version": "3.7",
"python-version": "3.11",
"database": "postgres",
"postgres-version": "10",
"extras": "all",
......@@ -62,7 +62,7 @@ trial_postgres_tests = [
if not IS_PR:
trial_postgres_tests.append(
{
"python-version": "3.10",
"python-version": "3.11",
"database": "postgres",
"postgres-version": "14",
"extras": "all",
......@@ -71,7 +71,7 @@ if not IS_PR:
trial_no_extra_tests = [
{
"python-version": "3.7",
"python-version": "3.11",
"database": "sqlite",
"extras": "",
}
......
......@@ -393,7 +393,7 @@ jobs:
- python-version: "3.7"
postgres-version: "10"
- python-version: "3.10"
- python-version: "3.11"
postgres-version: "14"
services:
......
Run unit tests against Python 3.11.
This diff is collapsed.
......@@ -15,6 +15,8 @@
import json
from unittest.mock import Mock
import ijson.common
from synapse.api.room_versions import RoomVersions
from synapse.federation.transport.client import SendJoinParser
from synapse.util import ExceptionBundle
......@@ -117,8 +119,17 @@ class SendJoinParserTestCase(TestCase):
coro_3 = Mock()
coro_3.close = Mock(side_effect=RuntimeError("Couldn't close coro 3"))
original_coros = parser._coros
parser._coros = [coro_1, coro_2, coro_3]
# Close the original coroutines. If we don't, when we garbage collect them
# they will throw, failing the test. (Oddly, this only started in CPython 3.11).
for coro in original_coros:
try:
coro.close()
except ijson.common.IncompleteJSONError:
pass
# Send half of the data to the parser
parser.write(serialisation[: len(serialisation) // 2])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment