Skip to content

Commit 9769da5

Browse files
authored
fix(ci): add pytest-timeout to dev deps so nightly stops failing daily (#477)
* fix(ci): add pytest-timeout to dev deps so nightly --timeout=60 stops failing * fix(tests): reset structlog defaults between tests to avoid stderr capture leak * chore(deps): regenerate uv.lock for pytest-timeout dev dep
1 parent 6a99775 commit 9769da5

3 files changed

Lines changed: 30 additions & 6 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ embeddings = [
4444
dev = [
4545
"pytest",
4646
"pytest-asyncio",
47+
"pytest-timeout",
4748
"ruff",
4849
]
4950
# E2B sandbox runner deps (scripts/e2b/*). Not needed for the package itself —

tests/conftest.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
"""Pytest fixtures shared across the whole test tree.
2-
3-
Currently only resets the singleton ChannelRuntime between tests so a test
4-
that monkeypatches `_build_channels` / channel sources doesn't get a stale
5-
cached runtime built by an earlier test.
6-
"""
1+
"""Pytest fixtures shared across the whole test tree."""
72

83
from __future__ import annotations
94

@@ -19,3 +14,17 @@ def _reset_channel_runtime():
1914
reset_channel_runtime()
2015
yield
2116
reset_channel_runtime()
17+
18+
19+
@pytest.fixture(autouse=True)
20+
def _reset_structlog():
21+
# autosearch/cli/main.py and autosearch/mcp/cli.py call
22+
# structlog.configure(WriteLoggerFactory(file=sys.stderr)) on entry.
23+
# Under pytest, sys.stderr is a per-test capture file that gets closed
24+
# at teardown. Without a reset, a later test logging through structlog
25+
# (e.g. Clarifier) writes to the closed file and raises ValueError.
26+
import structlog
27+
28+
structlog.reset_defaults()
29+
yield
30+
structlog.reset_defaults()

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)