$npx skillfedfor your agent

python-testing

Python Testing guides you through pytest fundamentals, fixture management, and test-driven development for Python 3.9+ projects. It covers unit and integration testing, async validation, mocking strategies, and coverage configuration to help you build maintainable test suites that meet quality standards.

Python Testing helps you write and structure unit tests using pytest with proper patterns and best practices.

AI-generated summary based on this skill's SKILL.md

323 29 MITupdated by athola

Decision gist · record as of 2026-07-27

Python Testing helps you write and structure unit tests using pytest with proper patterns and best practices. Python Testing guides you through pytest fundamentals, fixture management, and test-driven development for Python 3.9+ projects. It covers unit and integration testing, async validation, mocking strategies, and coverage configuration to help you build maintainable test suites that meet quality standards.

manual: git clone https://github.com/athola/claude-night-market → cp -r claude-night-market/plugins/parseltongue/skills/python-testing ~/.claude/skills/python-testing
plugins/parseltongue/skills/python-testing/SKILL.md · version df119d10

Use it when

  • Python Testing explains that fixtures are reusable test components defined with `@pytest.fixture` that provide setup and teardown logic.
  • Python Testing demonstrates mocking strategies using `unittest.mock` and pytest plugins.

Verify before relying

Read SKILL.md below before installing (7 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

athola/claude-night-market/python-testing · repository language: Python

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I write pytest tests in Python following best practices?

Python Testing teaches you to structure unit tests using the AAA pattern (Arrange, Act, Assert) with pytest. Start by organizing test files in a `tests/` directory, naming them `test_*.py`. Use descriptive test function names like `test_function_returns_expected_value()`. Python Testing covers proper assertions, test isolation, and how to leverage pytest's discovery mechanism to automatically find and run your tests.

What are pytest fixtures and how do I use them for test isolation?

Python Testing explains that fixtures are reusable test components defined with `@pytest.fixture` that provide setup and teardown logic. They enable test isolation by giving each test its own clean state. You can scope fixtures as `function`, `class`, `module`, or `session` depending on your needs. Python Testing shows how to use `conftest.py` to share fixtures across test modules and combine multiple fixtures in a single test.

How do I mock external dependencies with pytest?

Python Testing demonstrates mocking strategies using `unittest.mock` and pytest plugins. You can patch external calls with `@patch` decorators or use fixtures that return mock objects. Python Testing covers when to mock (external APIs, databases, file systems) versus when to use real objects, helping you avoid common anti-patterns and maintain fast, reliable tests that don't depend on external services.

How can I test asynchronous code with pytest-asyncio?

Python Testing covers async testing patterns using pytest-asyncio. Mark async test functions with `@pytest.mark.asyncio` and use `async def` syntax. Python Testing shows how to test coroutines, manage event loops, and structure fixtures for async workflows. It addresses timing issues and helps you validate that your async code behaves correctly under concurrent execution.

What pytest configuration options should I set in pyproject.toml?

Python Testing guides you through configuring pytest in `pyproject.toml` under `[tool.pytest.ini_options]`. Key settings include `testpaths` (where to find tests), `python_files` (test file naming), `addopts` (default command-line options), and `markers` (custom test markers). Python Testing also covers coverage configuration, minimum thresholds, and how to integrate linting and formatting tools into your test pipeline.

How do I set up test coverage reporting and enforce quality standards?

Python Testing explains coverage setup using `pytest-cov`, which measures how much of your code your tests exercise. Configure coverage thresholds in `pyproject.toml` to fail builds below a target percentage. Python Testing shows how to generate HTML reports, identify untested code paths, and use coverage data to improve test suite quality and catch gaps in your test-driven development workflow.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Python Testing Hub

Testing standards for pytest configuration, fixture management, and TDD implementation.

Table of Contents

  1. Quick Start
  2. When to Use
  3. Modules

Quick Start

  1. Dependencies: pip install pytest pytest-cov pytest-asyncio pytest-mock
  2. Configuration: Add the following to pyproject.toml: toml [tool.pytest.ini_options] testpaths = ["tests"] addopts = "--cov=src"

(truncated - see the full file via the links below)

File tree — 7 files
plugins/parseltongue/skills/python-testing/SKILL.md
plugins/parseltongue/skills/python-testing/modules/async-testing.md
plugins/parseltongue/skills/python-testing/modules/fixtures-and-mocking.md
plugins/parseltongue/skills/python-testing/modules/test-infrastructure.md
plugins/parseltongue/skills/python-testing/modules/test-quality.md
plugins/parseltongue/skills/python-testing/modules/testing-workflows.md
plugins/parseltongue/skills/python-testing/modules/unit-testing.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Write and structure unit tests using pytest with proper patterns”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

python-testing-patterns
by NickCrew · NickCrew/Claude-Cortex

Learn to build reliable test suites in Python using pytest, fixtures, and mocking strategies. This skill covers unit and integration testing, test organization, async testing, and coverage measurement. Discover patterns for parametrized tests, external dependency mocking, and test-driven development workflows.

MITupdated Jun 2026
★ 23repo stars
pytest-config
by athola · athola/claude-night-market

pytest-config provides templates and patterns for pytest setup, conftest.py fixtures, test markers, and coverage configuration. It includes Git testing helpers, mock fixtures for Claude Code tools, and GitHub Actions integration to automate test execution across Python projects.

MITupdated Jul 2026
★ 323repo stars
pytest
by bobmatnyc · bobmatnyc/claude-mpm-skills

pytest is Python's standard testing framework, enabling developers to write organized unit and integration tests through fixtures for dependency injection and parametrization for data-driven test cases. It supports async code, multiple test discovery patterns, and integrates seamlessly with FastAPI, Django, and Flask, plus a rich plugin ecosystem for coverage, mocking, and parallel execution.

MITupdated Jul 2026
★ 62repo stars
python-testing
by xu-xiang · xu-xiang/everything-claude-code-zh

Learn to build robust Python tests using pytest with test-driven development principles. This skill covers fixtures for setup and teardown, parametrization for running tests across multiple inputs, mocking to isolate dependencies, and achieving meaningful code coverage targets.

MITdocs in Chineseupdated Mar 2026
★ 1,767repo stars
Pytest Configuration
by dawiddutoit · dawiddutoit/custom-claude

Set up pytest with production-ready configuration patterns covering test discovery, async support, custom markers, and coverage reporting. Includes conftest.py hierarchy examples and fixture scoping strategies for consistent test behavior across environments.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
test-harness
by Mathews-Tom · Mathews-Tom/armory

Test Harness builds complete pytest test files from source code, automatically structuring tests across happy paths, edge cases, and error states. It designs fixtures by scope, applies focused mocks to external dependencies, and handles async patterns—all grounded in reconnaissance of your code's complexity and existing test coverage.

MITupdated Jul 2026
★ 274repo stars

More skills pytest (MIT) · testing-quality-standards (MIT) · Pest Testing (unlicensed)

Tags
test-frameworkmock-isolationcoverage-metricsasync-validationtest-structureci-cd-testingfixture-managementquality-gatesdependency-injection