pytest-testing
Installation
SKILL.md
Pytest Testing Standards
REFERENCE MODE: This skill provides reference material for writing pytest tests. Load standards on-demand based on current task.
Enforcement
Execution mode: Reference library; load standards on-demand for Python testing tasks.
Prohibited actions:
- Do not use
unittest.TestCasefor new tests; use plain pytest functions - Do not share mutable state between tests without fixture isolation
- Do not use
os.chdir()without restoration (usemonkeypatch.chdir())
Constraints:
- Tests must follow AAA (Arrange-Act-Assert) pattern
- Each test must be independent and isolated
- Fixtures must use appropriate scope (function/module/session)
- Working directory changes must be restored after each test