diff --git a/tests/replication/_base.py b/tests/replication/_base.py
index 624bd1b927..386ea70a25 100644
--- a/tests/replication/_base.py
+++ b/tests/replication/_base.py
@@ -550,12 +550,12 @@ class FakeRedisPubSubProtocol(Protocol):
if obj is None:
return "$-1\r\n"
if isinstance(obj, str):
- return "${len}\r\n{str}\r\n".format(len=len(obj), str=obj)
+ return f"${len(obj)}\r\n{obj}\r\n"
if isinstance(obj, int):
- return ":{val}\r\n".format(val=obj)
+ return f":{obj}\r\n"
if isinstance(obj, (list, tuple)):
items = "".join(self.encode(a) for a in obj)
- return "*{len}\r\n{items}".format(len=len(obj), items=items)
+ return f"*{len(obj)}\r\n{items}"
raise Exception("Unrecognized type for encoding redis: %r: %r", type(obj), obj)
diff --git a/tests/replication/test_multi_media_repo.py b/tests/replication/test_multi_media_repo.py
index 76e6644353..b42f1288eb 100644
--- a/tests/replication/test_multi_media_repo.py
+++ b/tests/replication/test_multi_media_repo.py
@@ -70,7 +70,7 @@ class MediaRepoShardTestCase(BaseMultiWorkerStreamTestCase):
self.reactor,
FakeSite(resource),
"GET",
- "/{}/{}".format(target, media_id),
+ f"/{target}/{media_id}",
shorthand=False,
access_token=self.access_token,
await_result=False,
@@ -113,7 +113,7 @@ class MediaRepoShardTestCase(BaseMultiWorkerStreamTestCase):
self.assertEqual(request.method, b"GET")
self.assertEqual(
request.path,
- "/_matrix/media/r0/download/{}/{}".format(target, media_id).encode("utf-8"),
+ f"/_matrix/media/r0/download/{target}/{media_id}".encode("utf-8"),
)
self.assertEqual(
request.requestHeaders.getRawHeaders(b"host"), [target.encode("utf-8")]
diff --git a/tests/replication/test_sharded_event_persister.py b/tests/replication/test_sharded_event_persister.py
index 5eca5c165d..f3615af97e 100644
--- a/tests/replication/test_sharded_event_persister.py
+++ b/tests/replication/test_sharded_event_persister.py
@@ -211,7 +211,7 @@ class EventPersisterShardTestCase(BaseMultiWorkerStreamTestCase):
self.reactor,
sync_hs_site,
"GET",
- "/sync?since={}".format(next_batch),
+ f"/sync?since={next_batch}",
access_token=access_token,
)
@@ -241,7 +241,7 @@ class EventPersisterShardTestCase(BaseMultiWorkerStreamTestCase):
self.reactor,
sync_hs_site,
"GET",
- "/sync?since={}".format(vector_clock_token),
+ f"/sync?since={vector_clock_token}",
access_token=access_token,
)
@@ -266,7 +266,7 @@ class EventPersisterShardTestCase(BaseMultiWorkerStreamTestCase):
self.reactor,
sync_hs_site,
"GET",
- "/sync?since={}".format(next_batch),
+ f"/sync?since={next_batch}",
access_token=access_token,
)
|