Skip to content

Commit 11ef628

Browse files
committed
fix(worker): allow empty test suite to pass in pre-push hook
- Add pytest-custom-exit-code plugin to suppress exit code 5 when no tests collected - Fix ruff lint errors (import sorting, AsyncIterator import path)
1 parent 3893d15 commit 11ef628

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

apps/worker/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dev = [
2020
"mypy>=1.14.0",
2121
"pytest>=8.3.0",
2222
"pytest-asyncio>=0.25.0",
23+
"pytest-custom-exit-code>=0.3.0",
2324
]
2425

2526
[tool.uv]
@@ -32,7 +33,7 @@ lint = "ruff check ."
3233
format = "ruff format ."
3334
check = ["lint", "format"]
3435
"type-check" = "mypy src"
35-
test = "pytest tests/"
36+
test = "pytest tests/ --suppress-no-test-exit-code"
3637

3738
[tool.pytest.ini_options]
3839
asyncio_mode = "auto"

apps/worker/src/lib/retry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from tenacity import (
22
retry,
3+
retry_if_exception_type,
34
stop_after_attempt,
45
wait_exponential,
5-
retry_if_exception_type,
66
)
77

88

apps/worker/src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import AsyncIterator
12
from contextlib import asynccontextmanager
2-
from typing import AsyncIterator
33

44
from fastapi import FastAPI
55

apps/worker/uv.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)