ワンクリックで
pytest-patterns
Pytest best practices including fixtures, parametrize, markers, and assertion patterns for Python test suites.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Pytest best practices including fixtures, parametrize, markers, and assertion patterns for Python test suites.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Translate natural language image descriptions into detailed, structured DALL-E prompts with subject, style, composition, lighting, and mood specifications.
Decompose mathematical problems into sub-expressions, evaluate each one with the calculator tool, and present the full working chain. Handles arithmetic, trigonometry, logarithms, and financial formulas.
Compare two or more PDF documents by extracting targeted sections, building a structured comparison matrix, and highlighting differences with page references.
Extract structured data from web pages using browser snapshot and text tools, then process it into tables, comparisons, or summaries using Python.
Analyze endpoint latency trends using historical check data from memory. Detects slow degradation, spikes vs sustained issues, and calculates baseline deviations.
Validate API response structure and content. Detects schema drift, unexpected null values, and abnormal response sizes.
| name | pytest-patterns |
| description | Pytest best practices including fixtures, parametrize, markers, and assertion patterns for Python test suites. |
| requires | {"bins":["python"]} |
Pytest patterns and best practices for Python test suites.
Use this skill when the project has pyproject.toml, setup.cfg, pytest.ini,
conftest.py, or a tests/ directory containing *_test.py or test_*.py
files.
test_<module>.py to mirror the source module they cover.class TestParseConfig:) when they
share setup or conceptually belong together.test_<behavior_under_test> -- the name should read
like a specification (e.g. test_parse_config_raises_on_missing_key).conftest.py so they are automatically
discovered by pytest.function (default, one per test), class,
module, session.yield fixtures for setup/teardown -- code after yield runs as
cleanup even if the test fails.@pytest.fixture(params=[...])) run every
dependent test once per parameter value.@pytest.mark.parametrize("x,expected", [(1, 2), (3, 6)]) runs the
test once per tuple.@pytest.mark.parametrize decorators stack -- pytest generates
the cartesian product.indirect=True to route parameter values through a fixture before
they reach the test.@pytest.mark.slow -- tag long-running tests so they can be skipped with
pytest -m "not slow".@pytest.mark.skip(reason="...") -- unconditionally skip.@pytest.mark.xfail(reason="...") -- expect failure; test still runs but
does not fail the suite.pyproject.toml under [tool.pytest.ini_options]
to avoid warnings.pytest -m "marker_name".assert -- pytest rewrites it to show detailed diffs on failure.with pytest.raises(ValueError, match=r"expected .* pattern"): for
exception type and message verification.pytest.approx(0.1 + 0.2, abs=1e-9) for floating-point comparisons.match= on pytest.raises to verify the error message, not just the
exception type.pytest -v -- verbose output with one line per test.pytest -x -- fail fast, stop on first failure.pytest -k "pattern" -- run only tests whose name matches the pattern.pytest --tb=short -- shorter tracebacks for quick scanning.unittest.TestCase unless the project already uses it.tmp_path or tmp_path_factory.sleep() in tests -- use mocking or polling helpers.print() statements in committed tests -- use logging or
capsys if output matters.