Verification: Run pytest to confirm discovery of files matching test_*.py.
When To Use
Constructing unit and integration tests for Python 3.9+ projects.
Isolating external dependencies using pytest-mock or custom monkeypatching.
Validating asynchronous logic with pytest-asyncio markers and event loop management.
Configuring project-wide coverage thresholds and reporting.
When NOT To Use
Evaluating test
quality - use pensive:test-review instead
Infrastructure test
config - use leyline:pytest-config
Evaluating test
quality - use pensive:test-review instead
Infrastructure test
config - use leyline:pytest-config
Modules
This skill uses modular loading to manage the system prompt budget.
Core Implementation
See modules/unit-testing.md - AAA (Arrange-Act-Assert) pattern, basic test structure, and exception validation.
See modules/fixtures-and-mocking.md - Request-scoped fixtures, parameterization, and boundary mocking.
See modules/async-testing.md - Coroutine testing, async fixtures, and concurrency validation.
Infrastructure & Workflow
See modules/test-infrastructure.md - Directory standards, conftest.py management, and coverage tools.
See modules/testing-workflows.md - Local execution patterns and GitHub Actions integration.
Standards
See modules/test-quality.md - Identification of common anti-patterns like broad exception catching or shared state between tests.
Exit Criteria
Tests implement the AAA pattern.
Coverage reaches the 80% project minimum.
Individual tests are independent and do not rely on execution order.
Fixtures are scoped appropriately (function, class, or session) to prevent side effects.
Mocking is restricted to external system boundaries.
Troubleshooting
Test Discovery: Verify filenames match the test_*.py pattern. Use pytest --collect-only to debug discovery paths.
Import Errors: Ensure the local source directory is in the path, typically by installing in editable mode with pip install -e ..
Async Failures: Confirm that pytest-asyncio is installed and that async tests use the @pytest.mark.asyncio decorator or corresponding auto-mode configuration.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: athola-claude-night-market-python-testing3description: Python Testing Hub4---5# Python Testing Hub67Testing standards for pytest configuration, fixture management, and TDD implementation.89## Table of Contents10111. [Quick Start](#quick-start)122. [When to Use](#when-to-use)133. [Modules](#modules)1415## Quick Start16171. **Dependencies**: `pip install pytest pytest-cov pytest-asyncio pytest-mock`182. **Configuration**: Add the following to `pyproject.toml`:19 ```toml20 [tool.pytest.ini_options]21 testpaths = ["tests"]22 addopts = "--cov=src"23 ```243. **Verification**: Run `pytest` to confirm discovery of files matching `test_*.py`.2526## When To Use2728- Constructing unit and integration tests for Python 3.9+ projects.29- Isolating external dependencies using `pytest-mock` or custom monkeypatching.30- Validating asynchronous logic with `pytest-asyncio` markers and event loop management.31- Configuring project-wide coverage thresholds and reporting.3233## When NOT To Use3435- Evaluating test36 quality - use pensive:test-review instead37- Infrastructure test38 config - use leyline:pytest-config39- Evaluating test40 quality - use pensive:test-review instead41- Infrastructure test42 config - use leyline:pytest-config4344## Modules4546This skill uses modular loading to manage the system prompt budget.4748### Core Implementation49- See `modules/unit-testing.md` - AAA (Arrange-Act-Assert) pattern, basic test structure, and exception validation.50- See `modules/fixtures-and-mocking.md` - Request-scoped fixtures, parameterization, and boundary mocking.51- See `modules/async-testing.md` - Coroutine testing, async fixtures, and concurrency validation.5253### Infrastructure & Workflow54- See `modules/test-infrastructure.md` - Directory standards, `conftest.py` management, and coverage tools.55- See `modules/testing-workflows.md` - Local execution patterns and GitHub Actions integration.5657### Standards58- See `modules/test-quality.md` - Identification of common anti-patterns like broad exception catching or shared state between tests.5960## Exit Criteria6162- Tests implement the AAA pattern.63- Coverage reaches the 80% project minimum.64- Individual tests are independent and do not rely on execution order.65- Fixtures are scoped appropriately (function, class, or session) to prevent side effects.66- Mocking is restricted to external system boundaries.6768## Troubleshooting6970- **Test Discovery**: Verify filenames match the `test_*.py` pattern. Use `pytest --collect-only` to debug discovery paths.71- **Import Errors**: Ensure the local source directory is in the path, typically by installing in editable mode with `pip install -e .`.72- **Async Failures**: Confirm that `pytest-asyncio` is installed and that async tests use the `@pytest.mark.asyncio` decorator or corresponding auto-mode configuration.7374---75> Converted and distributed by [TomeVault](https://tomevault.io/claim/athola) — claim your Tome and manage your conversions.76<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/athola-claude-night-market-python-testing in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Python Testing Hub It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.