Skip to content

Commit 5cd8490

Browse files
DanMeonclaude
andcommitted
fix(ci): test_async.py importorskip aiofiles + skip count 3→4
`test-without-extras` job 이 `test_async.py` 의 6 테스트를 ImportError 로 fail. 모듈-레벨 `pytest.importorskip("aiofiles")` 로 파일 전체를 skip 시켜 해결. ci.yml 의 `3 skipped` 검증을 `4 skipped` 로 (langchain×2, jsonschema, aiofiles). CLAUDE.md 메모도 stale "29" → 현재 4-file 정확한 설명으로 갱신. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 139d08f commit 5cd8490

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ jobs:
125125
- name: Run pytest — extras-gated tests must auto-skip via importorskip
126126
# ^ 파일-레벨 importorskip 은 해당 파일 전체를 skip 1개로 카운트.
127127
# 현재 gated 파일: test_langchain_loader.py + test_langchain_loader_ir.py
128-
# (langchain-core), test_ir_schema_export.py (jsonschema) → 총 3 파일
128+
# (langchain-core), test_ir_schema_export.py (jsonschema),
129+
# test_async.py (aiofiles) → 총 4 파일
129130
run: |
130131
uv run pytest tests/ -m "not slow" -v | tee pytest-output.txt
131-
if ! grep -qE '(^|[^0-9])3 skipped([^0-9]|$)' pytest-output.txt; then
132-
echo "::error::expected 3 extras-gated files to auto-skip via importorskip (langchain×2, jsonschema)"
132+
if ! grep -qE '(^|[^0-9])4 skipped([^0-9]|$)' pytest-output.txt; then
133+
echo "::error::expected 4 extras-gated files to auto-skip via importorskip (langchain×2, jsonschema, aiofiles)"
133134
exit 1
134135
fi

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ All rules from `~/.claude/CLAUDE.md` apply. This file adds only project-specific
5454
- Real HWP fixtures live in the submodule: `external/rhwp/samples/aift.hwp` (HWP5), `table-vpos-01.hwpx` (HWPX). `tests/conftest.py` + `benches/bench_gil.py` reference this path
5555
- When changing one path, change both
5656
- Markers: `slow` (PDF render), `langchain` (extras required). Default run: `pytest -m "not slow"`
57-
- LangChain tests auto-skip when `langchain-core` is missing (`pytest.importorskip`). Keep the skipped count at **exactly 29** — CI validates this
57+
- Extras-gated test files use module-level `pytest.importorskip` so the whole file counts as **1 skip** when the extra is missing. Current gated files: `test_langchain_loader.py` + `test_langchain_loader_ir.py` (langchain-core), `test_ir_schema_export.py` (jsonschema), `test_async.py` (aiofiles) → CI's `test-without-extras` job validates **exactly 4 skipped** (see `.github/workflows/ci.yml`). When adding a new extras-gated file, bump the count in both CLAUDE.md and ci.yml
5858
- `tests/type_check_errors.py` holds **exactly 4 intentional pyright errors** — CI validates that too. When editing, preserve count; don't fix them
5959

6060
### Git workflow

tests/test_async.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
from pathlib import Path
1414

1515
import pytest
16-
import rhwp
16+
17+
# ^ aiofiles 미설치 시 모듈 전체 skip — `[async]` extras 없는 CI job 에서 ImportError fail 회피
18+
pytest.importorskip("aiofiles")
19+
20+
import rhwp # noqa: E402
1721

1822

1923
def test_aparse_returns_document_instance(hwp_sample: Path) -> None:
@@ -65,9 +69,7 @@ async def flow():
6569
assert ir1 is ir2
6670

6771

68-
def test_aparse_raises_import_error_without_aiofiles(
69-
hwp_sample: Path, monkeypatch
70-
) -> None:
72+
def test_aparse_raises_import_error_without_aiofiles(hwp_sample: Path, monkeypatch) -> None:
7173
"""``aiofiles`` 미설치 시뮬레이션 — ``rhwp.aparse`` 는 명시적 ``ImportError``."""
7274
import builtins
7375

0 commit comments

Comments
 (0)