Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ target-version = "py310"
exclude = ["*.md"] # Markdown snippets: blacken-docs (CI), at 100

[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
select = ["E", "F", "I", "UP", "B", "ASYNC"]

[tool.ty.terminal]
error-on-warning = true
Expand Down
4 changes: 2 additions & 2 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def readinto(self, buffer):

async def go():
async with RawServer(ok) as server, HttpClient() as client:
with open(path, "rb") as f:
with open(path, "rb") as f: # noqa: ASYNC230 — testing multipart with a sync file object
await client.post(f"{server.url}/v1/upload", form=multipart(None, {"file": f}))
return server.received[0]

Expand Down Expand Up @@ -365,7 +365,7 @@ async def send_once_then_retry():
# (IOBasePayload._close); wait for that close so the second send never races
# ahead of the first send's cleanup
deadline = asyncio.get_running_loop().time() + 5.0
while not f.closed and asyncio.get_running_loop().time() < deadline:
while not f.closed and asyncio.get_running_loop().time() < deadline: # noqa: ASYNC110
await asyncio.sleep(0.005)
assert f.closed, "first send did not close the open file"
await client.post(f"{server.url}/v1/upload", form=multipart(None, {"file": f}))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1999,15 +1999,15 @@ async def results():
yield Done("r0", {}, {"v": 0}, None, {})
yield Done("r1", {}, {"v": 1}, None, {}) # size flush writes part 1
deadline = time.monotonic() + 2.0
while len(list(tmp_path.glob("part-*.parquet"))) < 1 and time.monotonic() < deadline:
while len(list(tmp_path.glob("part-*.parquet"))) < 1 and time.monotonic() < deadline: # noqa: ASYNC110
await asyncio.sleep(0.02)
assert len(list(tmp_path.glob("part-*.parquet"))) == 1
await asyncio.sleep(0.6) # 0.6 s since r0
yield Done("r2", {}, {"v": 2}, None, {}) # freshly buffered at ~0.6 s
await asyncio.sleep(0.5) # ~1.1 s since r0 (> 1.0 s), but only ~0.5 s since r2
events["parts_before_interval"] = len(list(tmp_path.glob("part-*.parquet")))
deadline = time.monotonic() + 3.0
while len(list(tmp_path.glob("part-*.parquet"))) < 2 and time.monotonic() < deadline:
while len(list(tmp_path.glob("part-*.parquet"))) < 2 and time.monotonic() < deadline: # noqa: ASYNC110
await asyncio.sleep(0.02)
events["parts_after_interval"] = len(list(tmp_path.glob("part-*.parquet")))

Expand Down