Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 30, 2024
1 parent 5f166a5 commit 003124a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pycrdt_websocket/ystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ async def check_version(self) -> int:
await anyio.Path(self.path).rename(new_path)
if version_mismatch:
async with await anyio.open_file(self.path, "wb") as f:
version_bytes = f"VERSION:{self.version}\n".encode() # noqa
version_bytes = f"VERSION:{self.version}\n".encode()
await f.write(version_bytes)
offset = len(version_bytes)
return offset
Expand Down Expand Up @@ -424,7 +424,7 @@ async def write(self, data: bytes) -> None:
async with db.execute(
"SELECT yupdate FROM yupdates WHERE path = ?", (self.path,)
) as cursor:
async for update, in cursor:
async for (update,) in cursor:
ydoc.apply_update(update)
# delete history
await db.execute("DELETE FROM yupdates WHERE path = ?", (self.path,))
Expand Down
2 changes: 1 addition & 1 deletion pycrdt_websocket/yutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def read_message(self) -> bytes | None:
if length == 0:
return b""
i1 = self.i0 + length
message = self.stream[self.i0 : i1] # noqa
message = self.stream[self.i0 : i1]
self.i0 = i1
self.length -= length
return message
Expand Down
4 changes: 2 additions & 2 deletions tests/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ async def test_asgi(unused_tcp_port):
ydoc1["map"] = ymap1 = Map()
ymap1["key"] = "value"
async with connect(
f"ws://localhost:{unused_tcp_port}/my-roomname" # noqa
f"ws://localhost:{unused_tcp_port}/my-roomname"
) as websocket1, WebsocketProvider(ydoc1, websocket1):
await sleep(0.1)

# client 2
ydoc2 = Doc()
async with connect(
f"ws://localhost:{unused_tcp_port}/my-roomname" # noqa
f"ws://localhost:{unused_tcp_port}/my-roomname"
) as websocket2, WebsocketProvider(ydoc2, websocket2):
await sleep(0.1)

Expand Down

0 comments on commit 003124a

Please sign in to comment.