From 410e5e5121f9b685bd00658096eb3b24315b13b9 Mon Sep 17 00:00:00 2001 From: Xubin Ren <52506698+Re-bin@users.noreply.github.com> Date: Fri, 14 Aug 2026 03:36:49 +0900 Subject: [PATCH] test(websocket): isolate persisted runtime data --- nanobot/channels/websocket/tests/conftest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 nanobot/channels/websocket/tests/conftest.py diff --git a/nanobot/channels/websocket/tests/conftest.py b/nanobot/channels/websocket/tests/conftest.py new file mode 100644 index 000000000..d5a23abd5 --- /dev/null +++ b/nanobot/channels/websocket/tests/conftest.py @@ -0,0 +1,14 @@ +"""Shared isolation for WebSocket tests that persist runtime state.""" + +from pathlib import Path + +import pytest + + +@pytest.fixture(autouse=True) +def isolate_websocket_runtime_data( + tmp_path: Path, + monkeypatch: pytest.MonkeyPatch, +) -> None: + """Keep transcripts and other runtime files out of the active user data directory.""" + monkeypatch.setattr("nanobot.config.paths.get_data_dir", lambda: tmp_path)