- Add python-development-database skill: metaorm patterns for tables, repositories, filters, settings, transactions, pagination, and exceptions - Add python-development-telegram-bot skill: aiogram bot service with polling/webhook, router structure, middlewares, inline keyboards, and pagination - Add python-development-tests skill: test organization guidelines with pytest, fixtures, and dependency injection rules - Update python-development-stack: replace SQLModel/SQLAlchemy with metaorm; add pytest, pytest-asyncio, pytest-cov, faker - Update python-development-fastapi: add sections for dependencies and list endpoints with ListResponse schema - Update python-development-code-style: allow ctx as exception for typer.Context parameter - Update python-development index with links to all three new skills Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.1 KiB
1.1 KiB
name, description
| name | description |
|---|---|
| python-development-tests | Guidelines for writing and organizing tests in Python services. Use when creating or modifying tests, fixtures, or test configuration. |
Rules
- All tests are located in the
testsfolder at the repository root. - The test directory structure mirrors the structure of the tested package. For example, if a module is at
project/database/service.py, the corresponding test must be attests/database/test_service.py. - Do not test protected methods or functions (
_method,_function). - Do not rely on or verify internal implementation details in tests.
- Use only public classes, objects, functions, and methods — and test only them.
- Do not use
monkeypatchor any form of patching in tests. - If internal behavior of an object needs to be changed, pass a mock object via the constructor or function argument (dependency injection).
- Actively use fixtures and
parametrizefor tests. - All fixtures are stored in
conftest.py. - Every test package has its own
conftest.py. - Make tests asynchronous where applicable.