MCPInstall

pytest

Provides comprehensive guidance for pytest testing framework including test writing, fixtures, parametrization, mocking, and plugins. Use when the user asks about pytest, needs to write Python tests, use pytest fixtures, or configure pytest for Python projects.

Installs
78
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/full-stack-skills/testing-skills --skill pytest
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads pytest automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

When to use this skill

Use this skill whenever the user wants to:

  • 用 pytest 编写或运行 Python 单元测试与 fixture
  • 使用断言、参数化、mock 与插件(覆盖率、并行)

How to use this skill

  1. 用例:test_ 前缀或 Test 类;assert 语句;@pytest.fixture、conftest.py。
  2. 运行:pytest、pytest -v -k "pattern"、pytest --cov;markers 与 xfail。
  3. 插件:pytest-cov、pytest-xdist、pytest-mock;pytest.ini 或 pyproject.toml 配置。

Best Practices

  • 单测独立、无副作用;用 fixture 准备数据与依赖。
  • 命名与目录清晰;避免依赖执行顺序。
  • CI 中跑全量;覆盖率与失败即停。

Keywords

pytest, Python 测试, fixture, 单元测试

FAQ

What does the pytest skill do?

Provides comprehensive guidance for pytest testing framework including test writing, fixtures, parametrization, mocking, and plugins. Use when the user asks about pytest, needs to write Python tests, use pytest fixtures, or configure pytest for Python projects.

How do I install pytest?

Run npx skills add https://github.com/full-stack-skills/testing-skills --skill pytest in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/pytest/ (personal) or .claude/skills/pytest/ (project).

Which AI agents can use pytest?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is pytest safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains pytest?

It is published by full-stack-skills in full-stack-skills/testing-skills. It has 78 recorded installs.

More from full-stack-skills/testing-skills

View all →

playwright

full-stack-skills/testing-skills

Open the skill to read its SKILL.md instructions.

Testing & QA88 installs

vitest

full-stack-skills/testing-skills

Open the skill to read its SKILL.md instructions.

Testing & QA86 installs

jest

full-stack-skills/testing-skills

Open the skill to read its SKILL.md instructions.

Testing & QA71 installs

junit

full-stack-skills/testing-skills

Open the skill to read its SKILL.md instructions.

Testing & QA66 installs

appium

full-stack-skills/testing-skills

Open the skill to read its SKILL.md instructions.

Testing & QA66 installs

selenium

full-stack-skills/testing-skills

Provides comprehensive guidance for Selenium WebDriver including browser automation, element location, waits, and test frameworks. Use when the user asks about Selenium, needs to automate web browsers, write Selenium tests, or work with Selenium WebDriver.

Testing & QA64 installs

Popular testing & qa skills

View category →

tdd

mattpocock/skills

Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Testing & QA1.2M installs

grilling

mattpocock/skills

Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

Testing & QA996.2K installs

migrate-to-shoehorn

mattpocock/skills

Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.

Testing & QA484.1K installs

run-train

lllllllama/rigorpilot-skills

Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.

Testing & QA337.8K installs

test-driven-development

obra/superpowers

Use when implementing any feature or bugfix, before writing implementation code

Testing & QA261.8K installs

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work

Testing & QA216.8K installs