pytest testing patterns for Python. Triggers on: pytest, fixture, mark, parametrize, mock, conftest, test coverage, unit test, integration test, pytest.raises.
Install with Tessl CLI
npx tessl i github:NeverSight/skills_feed --skill python-pytest-patterns83
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
Parametrize and exception testing
Parametrize usage
100%
100%
Parametrize case count
100%
100%
Stacked parametrize
0%
0%
pytest.raises context manager
100%
100%
match= parameter
0%
100%
exc_info.value inspection
100%
0%
No bare try/except for exceptions
100%
100%
xfail marker
0%
0%
skip or skipif marker
0%
0%
Multiple exception types tested
100%
100%
Without context: $0.5243 · 1m 45s · 27 turns · 34 in / 6,577 out tokens
With context: $0.6248 · 1m 59s · 32 turns · 117 in / 6,561 out tokens
conftest.py and fixture scopes
conftest.py exists
100%
100%
Session or module scope
100%
100%
yield-based teardown
100%
100%
Teardown after yield
100%
100%
Multiple fixture scopes
100%
100%
Custom marker registered
100%
100%
Custom marker applied
100%
100%
Fixture injection by name
100%
100%
conftest shared across files
100%
100%
Without context: $0.6508 · 2m 16s · 30 turns · 35 in / 9,670 out tokens
With context: $0.6318 · 2m 3s · 32 turns · 319 in / 7,389 out tokens
pytest-mock mocker fixture preference
mocker.patch used
0%
0%
No @patch decorator
100%
0%
No unittest.mock import
0%
0%
mocker injected as parameter
0%
0%
return_value set on mock
100%
100%
Mock call assertion
100%
100%
Error path mocked
100%
100%
Correct patch target
100%
100%
Without context: $0.4603 · 1m 37s · 27 turns · 33 in / 6,400 out tokens
With context: $0.6679 · 1m 58s · 33 turns · 470 in / 7,329 out tokens
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.