Skip to content
Back to skills

Python Testing

ASecurity

Write and fix tests in Python with pytest: use plain assert and fixtures, mocking at boundaries, async tests and CI settings.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentspythontesting

Security analysis

A100/100

Scanned December 2, 2026

npx -y skills add karthikrshet/saarthi --skill python-testing --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Testing?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Testing
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/karthikrshet-python-testing/badge)](https://www.skillsdirectory.com/skills/karthikrshet-python-testing)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-testing
description: "Write and fix tests in Python with pytest: use plain assert and fixtures, mocking at boundaries, async tests and CI settings."
tags: [python, testing]
---

# Python Testing

## When to use

- Writing or reviewing Python with pytest tests
- Setting up a test suite
- Fixing slow or flaky tests

## Procedure

1. Use plain assert and fixtures
2. Parametrize cases with pytest.mark.parametrize
3. Use tmp_path and monkeypatch instead of real files/env
4. Mock at boundaries with pytest-mock or respx for HTTP
5. Run with coverage (pytest --cov) and -x for fast feedback

## Checklist

- [ ] Fixtures scoped correctly
- [ ] No network in unit tests
- [ ] Async tests use pytest-asyncio or anyio

## Anti-patterns

- unittest-style classes for everything
- Fixtures with hidden side effects

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.