
    jS                        d Z ddlmZ ddlZddlmc mZ ddl	Z	ddl
mZ  ee      j                         j                  d   Zd	dZd
dZ e        dD ]
  Z ee        y)ub  tests/regression/normal_callback_registration_enforcement/conftest.py

task-2694+1 NORMAL_CALLBACK_REGISTRATION_ENFORCEMENT MT-6 회귀 테스트 fixture.

tests/conftest.py 가 /home/jay/workspace 를 sys.path 에 먼저 삽입한 뒤
무관한 import 사슬에서 dispatch / utils 패키지가 live workspace 본으로
캐싱될 수 있다. 본 conftest 는 worktree 본을 강제 로드하기 위해
- sys.path[0] 를 worktree root 로 보장
- dispatch / utils 패키지가 live workspace 본으로 캐싱돼 있으면 제거
한다 (tests/regression/conftest.py 의 부작용 최소화 원칙을 모방).
    )annotationsN)Path   c                     t        t              } | t        j                  v rt        j                  j	                  |        t        j                  j                  d|        y )Nr   )str_WORKTREE_ROOTsyspathremoveinsert)roots    Y/home/jay/workspace/tests/regression/normal_callback_registration_enforcement/conftest.py_ensure_worktree_firstr      s:    ~DsxxHHOOAt    c                   t         j                  j                  |       }|y t        |dd       xs d}t        |dd       }t	        t
              |v ry |rt        d |D              ry t         j                  j                  | d        y )N__file__ __path__c              3  >   K   | ]  }t        t              |v   y w)N)r   r   ).0entrys     r   	<genexpr>z)_evict_if_not_worktree.<locals>.<genexpr>$   s     =%^$-=s   )r	   modulesgetgetattrr   r   anypop)modnamecachedfps       r   _evict_if_not_worktreer"      sr    [[__W%F~
D)/RA
D)A
>aS=1==KKOOGT"r   )utilsz,utils.normal_callback_registration_validatorz"utils.callback_registration_markerdispatchz(dispatch.normal_fallback_callback_helper)returnNone)r   r   r%   r&   )__doc__
__future__r   builtins@py_builtins_pytest.assertion.rewrite	assertionrewrite
@pytest_arr	   pathlibr   r   resolveparentsr   r   r"   _mod r   r   <module>r4      sc   
 #   
 h'')11!4
#   !D 4 !r   