Update black, and run auto formatting over the codebase (#9381)

- Update black version to the latest
 - Run black auto formatting over the codebase
    - Run autoformatting according to [`docs/code_style.md
`](80d6dc9783/docs/code_style.md)
 - Update `code_style.md` docs around installing black to use the correct version
This commit is contained in:
Eric Eastwood 2021-02-16 16:32:34 -06:00 committed by GitHub
parent 5636e597c3
commit 0a00b7ff14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
271 changed files with 2802 additions and 1713 deletions

View file

@ -150,8 +150,8 @@ class RoomComplexityTests(unittest.FederatingHomeserverTestCase):
)
# Artificially raise the complexity
self.hs.get_datastore().get_current_state_event_counts = lambda x: make_awaitable(
600
self.hs.get_datastore().get_current_state_event_counts = (
lambda x: make_awaitable(600)
)
d = handler._remote_join(

View file

@ -279,7 +279,8 @@ class FederationSenderDevicesTestCases(HomeserverTestCase):
ret = self.get_success(
e2e_handler.upload_signatures_for_device_keys(
u1, {u1: {"D1": d1_json, "D2": d2_json}},
u1,
{u1: {"D1": d1_json, "D2": d2_json}},
)
)
self.assertEqual(ret["failures"], {})
@ -486,9 +487,11 @@ class FederationSenderDevicesTestCases(HomeserverTestCase):
self.assertGreaterEqual(content["stream_id"], prev_stream_id)
return content["stream_id"]
def check_signing_key_update_txn(self, txn: JsonDict,) -> None:
"""Check that the txn has an EDU with a signing key update.
"""
def check_signing_key_update_txn(
self,
txn: JsonDict,
) -> None:
"""Check that the txn has an EDU with a signing key update."""
edus = txn["edus"]
self.assertEqual(len(edus), 1)
@ -502,7 +505,9 @@ class FederationSenderDevicesTestCases(HomeserverTestCase):
self.get_success(
self.hs.get_e2e_keys_handler().upload_keys_for_user(
user_id, device_id, {"device_keys": device_dict},
user_id,
device_id,
{"device_keys": device_dict},
)
)
return sk