Skip to content

Structured pytest guide covering TDD, fixtures, mocking, and coverage gating for CI/CD pipelines.

CCM score
37 of 100
skills.sh installs
589
GitHub stars
7
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers pytest basics, fixtures and setup, mocking with unittest.mock, and coverage with CI/CD integration
  • Includes code examples for parametrized tests, conftest.py fixtures, patch-based API client tests, and a GitHub Actions workflow
  • Sets an --cov-fail-under=80 threshold in pytest.ini so builds fail when coverage drops below 80 percent
  • Designed for Python developers who want a guided path through TDD with three hands-on projects

Install

$ npx -y skills add pluginagentmarketplace/custom-plugin-python --skill 'Pytest Testing' -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Pytest Testing

Overview

Master software testing with pytest, Python's most popular testing framework. Learn test-driven development (TDD), write maintainable tests, and ensure code quality through comprehensive testing strategies.

Learning Objectives

  • Write unit, integration, and functional tests with pytest
  • Use fixtures for test setup and teardown
  • Mock external dependencies effectively
  • Implement test-driven development (TDD)
  • Measure and improve code coverage
  • Integrate tests with CI/CD pipelines

Core Topics

1. Pytest Basics

  • Test discovery and naming conventions
  • Assertions and comparison
  • Test organization (files, classes, modules)
  • Running tests (command-line options)
  • Markers and test selection
  • Parametrized tests

Code Example:

# test_calculator.py
import pytest

def add(a, b):
    return a + b

def divide(a, b):
    if b == 0:
        raise ValueError("Cannot divide by zero")
    return a / b

# Basic test
def test_add():
    assert add(2, 3) == 5
    assert add(-1, 1) == 0
    assert add(0, 0) == 0

Details

Repository
github.com/pluginagentmarketplace/custom-plugin-python
Categories
Testing & QA, Python
First seen
Jun 3, 2026

Questions

What does the Pytest Testing skill help me do?

The Pytest Testing skill teaches test-driven development with pytest, covering fixtures, mocking and CI/CD integration. It walks through writing unit, integration and functional tests and measuring code coverage.

How do I install the Pytest Testing skill?

Run npx -y skills add pluginagentmarketplace/custom-plugin-python --skill 'Pytest Testing' -y in a project. Once installed, the agent can write pytest tests, set up fixtures and mock external dependencies.

Which other skills sit in the same category?

Pytest Testing is in the Testing and QA category on Claude Marketplaces, alongside tdd, test-driven-development, webapp-testing, migrate-to-shoehorn and break-ui. It focuses specifically on pytest for Python code.

Does the skill cover mocking and CI integration?

Yes, the skill covers unittest.mock basics, patching objects and side effects. It also shows measuring coverage with pytest-cov and wiring tests into GitHub Actions and GitLab CI.

More from pluginagentmarketplace/custom-plugin-python

All 3

Similar to Pytest Testing

More Testing & QA