Agent skill · Testing & QA

python-testing

Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.

vibeevalgithub.com/vibeevalGitHub ↗
claude-codeMIT
Install
npx skills add vibeeval/vibecosystem --skill python-testing --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 19 KB
Bundled scripts: none
Path: skills/python-testing/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 521
Language: C#

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Outlines a structured approach for writing Python tests using pytest, following a TDD cycle (RED, GREEN, REFACTOR) and aiming for 80%+ code coverage with 100% coverage on critical paths. Includes patterns for basic tests, assertions, fixtures (including scopes, parameters, autouse, and conftest usage), parametrization (basic, multiple, IDs, and parametrized fixtures), markers, mocking and patching (including autospec and context managers), async testing, exception testing, side effects, and test organization. Also emphasizes best practices and setup steps for testing suites.

How it works

  • Activate when writing new Python code under TDD: red, green, refactor, designing test suites, reviewing coverage, or setting up testing infrastructure.
  • Follow the TDD cycle: RED (write failing test), GREEN (make test pass with minimal code), REFACTOR (improve code while keeping tests green).
  • Use coverage commands such as pytest --cov with appropriate reports to measure coverage.
  • Demonstrates basic test structure and common assertions (equality, inequality, truthiness, membership, comparisons, type checks, and exception testing).
  • Provides fixtures patterns: simple fixtures, fixtures with setup/teardown, scopes, parameterized fixtures, multiple fixtures, autouse fixtures, and conftest.py for shared fixtures.
  • Covers parametrization strategies: basic, multiple, IDs, and parametrized fixtures.
  • Introduces markers for test categorization and how to run selective tests via pytest -m with markers configured in pytest.ini.
  • Illustrates mocking and patching: function mocks, return values, exceptions, context managers, autospec, class instances, and mock properties.
  • Includes testing of async code with pytest-asyncio, async fixtures, and mocking async functions.
  • Details testing of exceptions and attributes and scenarios involving side effects like file operations and temp paths.
  • Provides a sample test organization layout with directories for unit, integration, and e2e tests, and code structure examples.
  • Ends with explicit best practices for tests: follow TDD, test single behavior, descriptive names, use fixtures, mock external dependencies, test edge cases, target 80%+ coverage, keep tests fast, and avoids brittle tests or testing implementation details.

When to use it

  • When writing new Python code under TDD guidelines.
  • When designing test suites for Python projects.
  • When reviewing Python test coverage.
  • When setting up testing infrastructure.

What it can touch

  • Mentions usage of pytest, conftest.py fixtures, and mocking tools from unittest.mock (patch, Mock, autospec).
  • Specifies commands and code snippets for pytest usage and demo patterns.

Caveats

  • The material is informational and demonstrates patterns; it states how to structure tests and measure coverage but does not guarantee outcomes beyond what is shown (e.g., tests and configurations used in examples).
From the SKILL.md

# Python Testing Patterns Comprehensive testing strategies for Python applications using pytest, TDD methodology, and best practices. ## When to Activate - Writing new Python code (follow TDD: red, green, refactor) - Designing test suites for Python projects - Reviewing Python test coverage - Setting up testing infrastructure ## Core Testing Philosophy ### Test-Driven Development (TDD) Always follow the TDD cycle: 1. **RED**: Write a failing test for the desired behavior 2. **GREEN**: Write minimal code to make the test pass 3. **REFACTOR**: Improve code while keeping tests green ```python # Step 1: Write failing test (RED) def test_add_numbers(): result = add(2, 3) assert result == 5 # Step 2: Write minimal implementation (GREEN) def add(a, b): return a + b # Step 3: Refactor if needed (REFACTOR) ``` ### Coverage Requirements - **Target**: 80%+ code coverage - **Critical paths**: 100% coverage required - Use `pytest --cov` to measure coverage ```bash pytest --cov=mypackage --cov-report=term-missing --cov-report=html ``` ## pytest Fundamentals ### Basic Test Structure ```python import pytest def test_addition(): """Test basic addition.""" assert 2 + 2 == 4 def test_string_uppercase

What's inside
Steps it walks through
  1. When to Activate
  2. Core Testing Philosophy
  3. Test-Driven Development (TDD)
  4. Coverage Requirements
  5. pytest Fundamentals
  6. Basic Test Structure
  7. Assertions
  8. Fixtures
  9. Basic Fixture Usage
  10. Fixture with Setup/Teardown
  11. Fixture Scopes
  12. Fixture with Parameters
  13. Using Multiple Fixtures
  14. Autouse Fixtures
Commands it runs
pytest --cov=mypackage --cov-report=term-missing --cov-report=html
Run only fast tests
pytest -m "not slow"
Run only integration tests
pytest -m integration
Run integration or slow tests
pytest -m "integration or slow"
Run tests marked as unit but not slow
pytest -m "unit and not slow"
Run all tests
More from vibecosystem
All skills →
About this skill
What does the python-testing skill do?

Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.

How do I install it?

Run `npx skills add vibeeval/vibecosystem --skill python-testing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going