Skip to main content
skill CX Codex

Pytest Testing — Claude Code skill: pytest tests, fixtures, mocks

A skill for writing pytest tests: fixtures, mocks, coverage and CI runs. Useful when a Python project's tests need structure.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add pluginagentmarketplace/custom-plugin-python --skill pytest-testing -a claude-code
Open on GitHub

What Pytest Testing does

The skill walks through pytest topic by topic: basic tests and parametrization, fixtures with different scopes, replacing external dependencies with unittest.mock, measuring coverage, and running tests in a pipeline. It ships code examples and a pytest.ini setup with a coverage threshold and HTML and XML reports.

There are hands-on projects too: a calculator built with TDD and a test suite for a REST API. The first asks you to write tests before the implementation, the second to cover requests and responses. This is not a syntax reference — it is a set of scenarios to work through with the agent.

Coverage measurement needs pytest-cov; CI runs need pytest in the environment. The skill is bonded to the 04-testing-quality subagent through PRIMARY_BOND, so pairing them keeps behaviour predictable.

What it helps with

  • write tests before the implementation in TDD style
  • move shared fixtures into conftest.py
  • mock HTTP calls and assert they happened once
  • set a coverage threshold in pytest.ini
  • run tests in GitHub Actions with a coverage report

Example prompts for the agent

  • Write tests for calculator.py TDD-style: tests first, then the implementation.
  • Move the sample users fixture into conftest.py and use it in test_users.py.
  • Mock requests.get in api_client.py and assert it was called once.

How to install Pytest Testing

1Skills CLI (Vercel)

npx skills add pluginagentmarketplace/custom-plugin-python --skill pytest-testing -a claude-code

2Manually: put the files in place

~/.claude/skills/pytest-testing/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/pytest-testing/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about Pytest Testing

How do I install Pytest Testing in Claude Code?

Run npx skills add pluginagentmarketplace/custom-plugin-python --skill pytest-testing -a claude-code. The skill file lands at ~/.claude/skills/pytest-testing/SKILL.md.

What does the Pytest Testing skill do?

It helps write pytest tests: fixtures, parametrization, mocks, coverage measurement and CI wiring. Code examples and hands-on projects are included.

What do I need for the skill to work?

pytest in the project environment, and pytest-cov for coverage. The skill is bonded to the 04-testing-quality subagent.

Similar skills

Everything for Testing and QA →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor