testing-discipline
Skill6 starsChanged 4 months agoMITView on GitHub
Дисциплина тестов проекта: pytest + asyncio, моки внешних систем, без сети, тест на новое поведение, целевое покрытие.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- oleg494/coding-kittheir own version, first seen Nov 1, 2026
- oribarilan/97their own version, first seen Nov 1, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- oribarilan/97★ 25same name
- oleg494/coding-kit★ 3same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/agents.mdcCursor rule
- architecture-disciplineSkill
- async-disciplineSkill
- automation-disciplineSkill
- debugging-disciplineSkill
- documentation-disciplineSkill
- error-handling-disciplineSkill
- git-disciplineSkill
- prompt-injection-defenseSkill
- pr-review-disciplineSkill
- pull-request-disciplineSkill
- skill-authoringSkill
The file
Files
Skill: testing-discipline
Правила тестирования этого проекта. Источник истины — _docs/testing.md и _docs/instructions.md §8.
Когда использовать
- Пишешь или меняешь код в
app/— нужен unit-тест на новое поведение. - Готовишь задачу к коммиту — нужен зелёный
pytest -q. - Чинишь баг — нужен падающий тест, воспроизводящий дефект.
Не использовать для чисто-документационных задач (правят только _docs/, _board/, README.md, .env.example, app/skills/, app/prompts/) — они освобождены от теста, в DoD ставится n/a.
Алгоритм
- Размести тест зеркально коду:
tests/<пакет>/test_<name>.py. - Используй
pytest+pytest-asyncio(asyncio_mode = "auto"), фикстуруmocker. - Замокай все внешние системы (никакой реальной сети):
- Telegram:
Message/Bot→MagicMock/AsyncMock; - Ollama:
mocker.patch.object(client, "chat"/"embed", ...); ddgs:mocker.patch("ddgs.DDGS.text", ...);httpx:MockTransport/respx;app/skills/,app/prompts/: путь →tmp_path.
- Telegram:
- Исключение:
SemanticMemoryтестируй с реальнымsqlite-vecнаtmp_path; если extension не грузится —pytest.skip. - Покрой happy path, ошибки домена (
ToolError,LLMTimeout,LLMUnavailable,LLMBadResponse,ArgsValidationError), границы (пустой результат, усечение до лимита, превышение лимитов цикла). - При необходимости проверь логи через
caplog(step=,tool=<name>,status=). - Прогон:
pytest -q— зелёный. Цель покрытия:app/≥ 70%,services//agents//tools/≥ 85%,app/agents/protocol.py— 100%.
Чего избегать
- Реальных вызовов Telegram / Ollama / интернета.
- Маскировки падений через
pytest -k/skipвместо починки. - Ослабления или удаления существующих тестов без явного указания.
- Недетерминизма (зависимость от времени, порядка, внешних данных).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

