python-testing
Python testing patterns: pytest setup, fixtures, TDD, mocking, async tests, and integration tests
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/athola/nm-parseltongue-python-testingNight Market Skill — ported from claude-night-market/parseltongue. For the full experience with agents, hooks, and commands, install the Claude Code plugin.
Python Testing Hub
Testing standards for pytest configuration, fixture management, and TDD implementation.
Table of Contents
- Quick Start
- When to Use
- Modules
Quick Start
- Dependencies:
pip install pytest pytest-cov pytest-asyncio pytest-mock - Configuration: Add the following to
pyproject.toml:[tool.pytest.ini_options] testpaths = ["tests"] addopts = "--cov=src" - Verification: Run
pytestto confirm discovery of files matchingtest_*.py.
When To Use
- Constructing unit and integration tests for Python 3.9+ projects.
- Isolating external dependencies using
pytest-mockor custom monkeypatching. - Validating asynchronous logic with
pytest-asynciomarkers 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.pymanagement, 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_*.pypattern. Usepytest --collect-onlyto 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-asynciois installed and that async tests use the@pytest.mark.asynciodecorator or corresponding auto-mode configuration.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-athola-nm-parseltongue-python-testing": {
"enabled": true,
"auto_update": true
}
}
}Related Skills
extract
Analyze a codebase and build a knowledge base of business logic, architecture, data flow, and engineering patterns. The foundation for gauntlet challenges and agent integration
discourse
>- Scan community discussion channels (HN, Lobsters, Reddit, tech blogs) for experience reports and opinions on a topic
synthesize
>- Merge, deduplicate, rank, and format research findings from multiple channels into a coherent report. Use after research agents return their results
workflow-monitor
Detect workflow failures and inefficient patterns, then create GitHub issues for improvement via /fix-workflow
architecture-paradigm-hexagonal
Hexagonal (Ports and Adapters) architecture isolating domain logic from infrastructure