$npx skillfedfor your agent

Pytest Testing

Master pytest through test-driven development, fixtures, and mocking strategies. Build comprehensive test suites with parametrized tests, external dependency mocking, and CI/CD pipeline integration while measuring code coverage.

Pytest Testing teaches you to run and execute pytest tests for Python projects using fixtures, mocking, and coverage measurement.

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

5 2 unlicensed, metadata onlyupdated by pluginagentmarketplace

Decision gist · record as of 2026-01-05

Pytest Testing teaches you to run and execute pytest tests for Python projects using fixtures, mocking, and coverage measurement. Master pytest through test-driven development, fixtures, and mocking strategies. Build comprehensive test suites with parametrized tests, external dependency mocking, and CI/CD pipeline integration while measuring code coverage.

manual: git clone https://github.com/pluginagentmarketplace/custom-plugin-python → cp -r custom-plugin-python ~/.claude/skills/pytest-testing

Use it when

  • Pytest Testing fixtures are reusable functions that provide setup and teardown for your tests.
  • Pytest Testing uses `pytest.ini`, `setup.cfg`, or `pyproject.toml` files to configure behavior like test paths, markers, and plugins.
Same gist for agents: .md · .json

Install

pluginagentmarketplace/custom-plugin-python/pytest-testing · repository language: Python

generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub

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 to use pytest for Python testing?

Pytest Testing is a powerful framework for running and executing tests in Python projects. To use pytest, install it via pip, write test functions prefixed with `test_`, and run `pytest` from your command line. Pytest automatically discovers tests in files matching `test_*.py` or `*_test.py` patterns. You can run specific tests, use markers to organize tests, and leverage fixtures for setup and teardown. The framework supports assertions, parametrization for testing multiple inputs, and integration with CI/CD pipelines for automated quality checks.

What are pytest fixtures and how do they work?

Pytest Testing fixtures are reusable functions that provide setup and teardown for your tests. Define fixtures using the `@pytest.fixture` decorator; they can return data, configure resources, or perform cleanup. Fixtures are passed as arguments to test functions by name, enabling dependency injection and reducing code duplication. Common use cases include database connections, mock objects, temporary files, and API clients. Pytest's fixture system supports scopes (function, class, module, session) to control how long resources persist, making tests cleaner and more maintainable.

Pytest configuration setup and test discovery explained?

Pytest Testing uses `pytest.ini`, `setup.cfg`, or `pyproject.toml` files to configure behavior like test paths, markers, and plugins. Test discovery automatically finds tests in directories matching patterns like `test_*.py` or `*_test.py`, and within test classes named `Test*`. You can customize discovery with the `testpaths` option, exclude directories, and set minimum Python versions. Configuration also controls output verbosity, parallel execution, coverage thresholds, and fixture availability. Proper setup ensures consistent test execution across development and CI/CD environments.

How does pytest parametrize tests with multiple inputs?

Pytest Testing's `@pytest.mark.parametrize` decorator lets you run the same test with different input values, eliminating code duplication. Specify parameter names and a list of values; pytest generates separate test cases for each combination. For example, parametrizing a validation function tests multiple valid and invalid inputs in one concise test. You can stack multiple parametrize decorators for matrix testing. This approach improves test coverage, makes tests more readable, and simplifies maintenance when adding new test cases.

How can I generate test coverage and quality reports with pytest?

Pytest Testing integrates with coverage tools to measure code coverage. Install `pytest-cov`, then run `pytest --cov=your_module` to generate coverage reports showing which lines were executed. Generate HTML reports with `--cov-report=html` for visual inspection. Pytest also supports plugins like `pytest-html` for detailed test reports and `pytest-xdist` for parallel execution. These reports help identify untested code paths, track quality metrics over time, and enforce coverage thresholds in CI/CD pipelines.

What techniques help debug and troubleshoot failing pytest tests?

Pytest Testing offers several debugging strategies: use `pytest -v` for verbose output showing test names and results, `pytest -s` to capture print statements, and `pytest --tb=short` for concise tracebacks. The `-x` flag stops after the first failure, `-lf` reruns last failures, and `--pdb` drops into the debugger on failure. Add `pytest.set_trace()` in code for breakpoints. Use markers like `@pytest.mark.skip` or `@pytest.mark.xfail` to manage problematic tests. Fixtures with mocking isolate dependencies, making failures easier to diagnose.

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 › “Run and execute pytest tests for Python projects”

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
python-testing
by affaan-m · affaan-m/ECC

Learn pytest essentials and test-driven development patterns for Python projects. This skill covers fixtures, parametrization, mocking, and coverage strategies to build reliable test suites. Follow the red-green-refactor cycle and achieve 80%+ code coverage on your critical paths.

MITupdated Jul 2026
★ 234,207repo 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
python-testing-patterns
by HermeticOrmus · HermeticOrmus/LibreUIUX-Claude-Code

Learn to structure Python tests using pytest, fixtures, parameterization, and mocking techniques. This skill covers unit and integration testing, test isolation, the AAA pattern, and debugging strategies to establish reliable test infrastructure.

MITupdated May 2026
★ 86repo stars
Pytest Patterns
by manutej · manutej/luxor-claude-marketplace

Pytest Patterns teaches you to write reliable Python tests using pytest's core features—fixtures for setup and teardown, parametrization to run tests with multiple inputs, and mocking to isolate dependencies. Learn test organization, coverage analysis, and CI/CD integration to scale from simple unit tests to complex test suites.

no license declared → metadata onlyupdated Jun 2026
★ 61repo stars

More skills Textual Test Fixtures (unlicensed) · Pytest Coder (NOASSERTION) · python-testing (MIT) · pytest-skill (MIT) · python-testing-patterns (MIT) · Java Testing (NOASSERTION)

Tags
test-automationpython-testingunit-testingtest-frameworkqa-toolscontinuous-integrationtest-fixturescode-qualitydeveloper-toolstesting-patterns