o
    hY	                     @   sz   d dl Z d dlZd dlmZ d dlmZ ddlmZ ddlmZ ddl	m
Z
 d dlmZ d	d
ddddZG dd dZdS )    N)Path)Optional   )LEGACY_PATH)legacy_path)HOOK_LEGACY_PATH_ARG)_check_path)collection_pathpath)	file_pathr
   )module_pathr
   )
start_pathstartdir)pytest_ignore_collectpytest_collect_filepytest_pycollect_makemodulepytest_report_headerpytest_report_collectionfinishc                   @   s.   e Zd ZdZdd Zdd ZejfddZdS )	PathAwareHookProxyz
    this helper wraps around hook callers
    until pluggy supports fixingcalls, this one will do

    it currently doesn't return full hook caller proxies for fixed hooks,
    this may have to be changed later depending on bugs
    c                 C   s
   || _ d S N) _PathAwareHookProxy__hook_caller)selfhook_caller r   K/var/www/html/ai/venv/lib/python3.10/site-packages/_pytest/config/compat.py__init__      
zPathAwareHookProxy.__init__c                 C   s
   t | jS r   )dirr   )r   r   r   r   __dir__!   r   zPathAwareHookProxy.__dir__c                    sZ   t | j||tvr| j|< S t| \ | fdd}||_|| j|< |S )Nc                     s   |  d }|   d }|d urtjtj ddd |d ur/|d ur*t|| nt|}n
|d us5J t|}|| < ||  < di | S )N)pylib_path_argpathlib_path_argr   )
stacklevelr   )popwarningswarnr   formatr   r   r   )kw
path_valuefspath_value
fspath_varhookpath_varr   r   
fixed_hook,   s$   
z2PathAwareHookProxy.__getattr__.<locals>.fixed_hook)getattrr   imply_paths_hooks__dict____name__)r   key_wrapsr-   r   r)   r   __getattr__$   s   

zPathAwareHookProxy.__getattr__N)	r1   
__module____qualname____doc__r   r   	functoolswrapsr4   r   r   r   r   r      s
    r   )r8   r#   pathlibr   typingr   compatr   r   
deprecatedr   _pytest.nodesr   r/   r   r   r   r   r   <module>   s    	