소스 정보
- 저장소
- MarieLynneBlock/arcanum-artifex
- 최근 소스 활동
- 2026년 7월 10일 07:31
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/MarieLynneBlock/arcanum-artifex --skill create-pytests명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | create-pytests |
| description | Generates pytest test files for a Python codebase (or a targeted scope) that: |
| version | 1.0.0 |
| tags | ["testing","pytest","python","coverage","pyproject"] |
| metadata | {"skill-author":"Marie-Lynne Block"} |
Generates pytest test files for a Python codebase (or a targeted scope) that:
test_*.py files, test_ prefix functions and methods, Test prefix classes).@pytest.mark.integration.pyproject.toml with the [tool.pytest.ini_options] block using --import-mode=importlib.src/ vs flat) and configure accordingly.tests/ directory and no pyproject.toml pytest configuration.Do NOT use this skill for:
test-strategy skill instead.| Layout | Indicator | testpaths | Import mode |
|---|---|---|---|
src/ layout | src/ directory at root | ["tests"] | importlib |
| Flat layout | Package at root, no src/ | ["tests"] | importlib |
| Inline tests | No tests/ dir — tests live next to source | auto-discovery | importlib |
Always prefer tests outside application code (tests/ at root). Do not create an init file in tests/ — it is not needed under importlib mode and causes import confusion.
Test in this order when 80% coverage is the target:
_name) — test indirectly through their public callers; mark skipped in the gap report.if __name__ == "__main__":) — note as manual test candidates; apply # pragma: no cover.@pytest.mark.integration; exclude from the 80% threshold.setup.py test or any pytest-runner invocation — deprecated and removed.mock.patch a real, in-process implementation — use the real class.tests/.Read the user's request:
For a large codebase, list the files to be created and ask for confirmation before generating.
Check for the presence of:
src/ directory at the project root → src/ layout.tests/ directory → confirm placement; use it.pyproject.toml → read [tool.pytest.ini_options] before updating.pyproject.tomlIf pyproject.toml does not exist, create it. If it exists but has no [tool.pytest.ini_options] section, add only that section. Never overwrite an existing [project] block.
Required minimum:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "PACKAGENAME"
version = "PACKAGEVERSION"
[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
testpaths = ["tests"]
markers = [
"integration: tests that require live external services (deselect with '-m not integration')",
]
Replace PACKAGENAME with the detected package name and PACKAGEVERSION with "0.1.0" if none exists.
For each module in scope:
tests/test_<module>.py file.@pytest.mark.integration._name), do NOT write direct tests — test them indirectly through their callers.@pytest.mark.parametrize when multiple inputs test the same logic.pytest.raises(ExceptionType, match="pattern") for all exception cases — never omit match=.Enforce these naming rules:
test_<module>.py (preferred) or <module>_test.pytest_<what_it_tests>TestClassName (PascalCase, Test prefix, no init method)tests/After the test files, always output a ## Coverage Gap Report section:
## Coverage Gap Report
### Covered
| Module | Items tested | Test file |
| --- | --- | --- |
| `src/mypkg/app.py` | `create_app`, all routes, 404 handler | `tests/test_app.py` |
| `src/mypkg/models.py` | `Item` init, `to_dict`, `from_dict` (valid + invalid), `save` | `tests/test_models.py` |
### Skipped
| Module | Item | Reason |
| --- | --- | --- |
| `src/mypkg/app.py` | `_configure_logging()` | Private helper — exercised indirectly via every `create_app()` call |
| `src/mypkg/app.py` | `if __name__ == "__main__":` | CLI entrypoint — `# pragma: no cover` applied |
### Estimated coverage
| Module | Estimated line coverage | At 80% target? |
| --- | --- | --- |
| `app.py` | ~87% | Yes |
| `models.py` | ~93% | Yes |
For each run the skill produces:
pyproject.toml — created or updated with [tool.pytest.ini_options].When generating for a whole codebase, list all files to be created before generating them.
Input: "Write pytest tests for my Flask API project."
Steps the skill takes:
src/flaskapi/ layout.pyproject.toml with hatchling backend and --import-mode=importlib.tests/test_app.py covering all public routes (happy path, 404, validation errors).tests/test_models.py covering all Item methods including save.@pytest.mark.integration._configure_logging skipped as a private helper.Input: "Write tests for the parse_date function in utils.py."
Steps the skill takes:
tests/test_utils.py covering: valid ISO date string, invalid format raises ValueError, empty string raises ValueError, timezone-aware input, leap year boundary.utils.py are out of scope.pyproject.toml, missing pytest configInput: "Add pytest config — I already have a pyproject.toml."
Steps the skill takes:
pyproject.toml.[tool.pytest.ini_options] block with addopts = ["--import-mode=importlib"].[project], [build-system], or any other existing section.--import-mode=importlib. It avoids sys.path manipulation and will become the default in a future pytest major version. See references/test-layout.md.tests/. Under importlib mode it is not needed, and adding one causes import confusion.@pytest.mark.integration tests go in the same test files as unit tests but are excluded from the default run with -m "not integration". Declare the marker in [tool.pytest.ini_options].test-strategy (define what to test before generating) and code-review (review generated tests for correctness and quality).references/project-setup.md, references/test-layout.md, references/pytest-config.md, references/discovery-conventions.md, references/coverage-and-quality.md.