ワンクリックで
python-testing
DeepSearch pytest guide for targeted tests, fixtures, async mocks, live-test gates, and artifact-safe test data.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
DeepSearch pytest guide for targeted tests, fixtures, async mocks, live-test gates, and artifact-safe test data.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
DeepSearch Python patterns for layering, config models, custom exceptions, logging, path safety, prompts, and async cleanup.
Security review checklist for DeepSearch changes involving secrets, file paths, LLM/search providers, prompts, server APIs, storage, and logs.
Verify DeepSearch changes with scoped diff review, import checks, pytest, optional live tests, and artifact hygiene.
| name | python-testing |
| description | DeepSearch pytest guide for targeted tests, fixtures, async mocks, live-test gates, and artifact-safe test data. |
Use this when adding or updating DeepSearch tests.
uv run pytest tests/path/to/test_file.py
uv run pytest -m "not llm"
RUN_LLM_TESTS=1 uv run pytest -m llm
Run live tests only when explicitly requested and credentials are configured.
conftest.py.tmp_path for generated reports, markdown/html/docx files, logs, and databases.monkeypatch for environment variables and runtime config.AsyncMock for async LLM/search calls.Pytest uses strict asyncio mode. Mark async tests explicitly and ensure background tasks are awaited or cancelled.
import pytest
from unittest.mock import AsyncMock
@pytest.mark.asyncio
async def test_node_uses_llm(monkeypatch):
fake_call = AsyncMock(return_value={"result": "ok"})
monkeypatch.setattr("module.path.call_llm", fake_call)
result = await run_node()
assert result["result"] == "ok"
fake_call.assert_awaited_once()
@pytest.mark.llm.RUN_LLM_TESTS=1.uv run pytest.