원클릭으로
writing-tests
Use when writing new pytest tests, fixtures, or regression tests for aiida-core.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when writing new pytest tests, fixtures, or regression tests for aiida-core.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when adding a new `verdi` subcommand in `src/aiida/cmdline/`.
Use when adding a new third-party dependency to aiida-core's `pyproject.toml`.
Use when exploring the aiida-core codebase structure, looking for key files, or understanding how packages relate to each other.
Use when making commits, creating branches, or preparing pull requests for aiida-core.
Use when diagnosing failed, stuck, or misbehaving AiiDA processes or the daemon.
Use when deprecating a public Python API or `verdi` CLI command in aiida-core.
| name | writing-tests |
| description | Use when writing new pytest tests, fixtures, or regression tests for aiida-core. |
Tests live under tests/ and mirror the source layout in src/aiida/.
Reusable fixtures live in tests/conftest.py and per-subtree conftest.py files.
assert result == expected_value, not assert result is not None.
Check exact values, types, and lengths.@pytest.mark.presto: runs against SqliteTempBackend (in-memory, no PostgreSQL / RabbitMQ).
Prefer presto-compatible tests where possible: they are much faster and runnable in any environment.@pytest.mark.requires_rmq: requires a running RabbitMQ instance.@pytest.mark.requires_psql: requires a running PostgreSQL instance.@pytest.mark.nightly: long-running tests, only executed in nightly CI.Use pytest.mark.parametrize instead of duplicating test bodies:
import pytest
@pytest.mark.parametrize('value,expected', [
(1, 2),
(2, 4),
(3, 6),
])
def test_double(value, expected):
assert double(value) == expected
Check tests/conftest.py before writing ad-hoc setup.
If you find yourself reinventing a fixture, it probably already exists.
See the running-tests skill for the full uv run pytest cheatsheet.