pytest

Installation
SKILL.md

Skill: pytest

Best practices for writing and organizing tests with pytest including fixtures, parametrize, and plugins.

When to Use

Apply this skill when writing and organizing tests with pytest — fixtures, parametrize, markers, plugins, and test structure.

Test Organization

  • Place tests in a tests/ directory mirroring the source structure.
  • Name test files test_<module>.py and test functions test_<behavior>().
  • Group related tests in classes only when they share fixtures/setup.

Fixtures

  • Define fixtures at the narrowest scope needed (function > class > module > session).
  • Use conftest.py for shared fixtures; put it at the appropriate directory level.
  • Prefer factory fixtures over complex fixture inheritance.
Related skills
Installs
8
GitHub Stars
2.4K
First Seen
Apr 8, 2026