Skip to content

Commit df281e7

Browse files
committed
수정: Hypothesis 를 설치하지 않는 eval-rule 검사에서 conftest 가 가져오기 오류로 떨어지던 것을 설치된 때만 설정하도록 고친다
시간 검사를 끄는 Hypothesis 설정을 conftest 맨 위에서 바로 가져와, pytest 만 설치하는 eval-rule 검사가 ModuleNotFoundError 로 시작도 못 했다. 설치 여부를 먼저 보고 설치된 때만 설정한다. Hypothesis 를 막은 환경에서 eval-rule 시험 17개 통과, Hypothesis 를 쓰는 ratios 시험 19개 통과를 확인했다.
1 parent df49449 commit df281e7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎tests/conftest.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
"""
2626

2727
import gc
28+
import importlib.util
2829
import os
2930
from pathlib import Path
3031

3132
import pytest
32-
from hypothesis import HealthCheck, settings
3333

3434
# 테스트 전역 ambient refresh 차단. freshness 배선(scan·panel·allFilings·검색 인덱스)은
3535
# "로컬 존재 + etag/마커 없음" 을 stale 로 보고 원격 재확인을 시작하는데, 테스트가 만든
@@ -48,8 +48,12 @@
4848
# 20.8초 걸렸다(2026-11-07 실측). 값 만들기가 1초를 넘으면 "값 만들기가 느리다"는 건강 검사(too_slow)가
4949
# 시험 내용과 상관없이 떨어졌고, 푸시 전 검사 5번 중 3번 test_ratios_metamorphic 이 그랬다.
5050
# 시간만 보는 이 검사 하나만 끈다. 시험 결과를 가리는 다른 건강 검사는 그대로 둔다.
51-
settings.register_profile("dartlab", suppress_health_check=[HealthCheck.too_slow])
52-
settings.load_profile("dartlab")
51+
# Hypothesis 를 설치하지 않고 pytest 만 도는 검사(eval-rule)가 있어 설치된 때만 설정한다.
52+
if importlib.util.find_spec("hypothesis") is not None:
53+
from hypothesis import HealthCheck, settings # noqa: E402
54+
55+
settings.register_profile("dartlab", suppress_health_check=[HealthCheck.too_slow])
56+
settings.load_profile("dartlab")
5357
# pytest-benchmark 는 저장을 안 하는 실행에서도 기본 저장소 `./.benchmarks` 를 만든다.
5458
_BENCHMARK_DEFAULT_STORAGE = "file://./.benchmarks"
5559

0 commit comments

Comments
 (0)