o
    Zhz                     @  s   U d dl mZ d dlZd dlmZ d dlmZ d dlmZ 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ddddZded< dddZG dd dZdS )    )annotationsN)Path)Any)Mapping   )LEGACY_PATH)legacy_path)HOOK_LEGACY_PATH_ARG)Zcollection_pathpath)	file_pathr
   )module_pathr
   )Z
start_pathZstartdir)Zpytest_ignore_collectZpytest_collect_fileZpytest_pycollect_makemoduleZpytest_report_headerZpytest_report_collectionfinishzMapping[str, tuple[str, str]]imply_paths_hooksr
   r   fspathr   returnNonec                 C  s&   t || krtd|d| dd S )NzPath(z) != z8
if both path and fspath are given they need to be equal)r   
ValueError)r
   r    r   L/var/www/html/lang_env/lib/python3.10/site-packages/_pytest/config/compat.py_check_path   s
   r   c                   @  s.   e Zd ZdZdddZdd	d
Zd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
    
hook_relaypluggy.HookRelayr   r   c                 C  s
   || _ d S N)_hook_relay)selfr   r   r   r   __init__+      
zPathAwareHookProxy.__init__	list[str]c                 C  s
   t | jS r   )dirr   )r   r   r   r   __dir__.   r   zPathAwareHookProxy.__dir__keystrpluggy.HookCallerc                   sn   t | j||tvr| j|< S t| \ td fdd}j|_j|_||_|| j|< |S )Nkwr   r   c                    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)Zpylib_path_argZpathlib_path_argr   )
stacklevelr   )popwarningswarnr	   formatr   r   r   )r#   Z
path_valueZfspath_valueZ
fspath_varhookZpath_varr   r   
fixed_hook9   s$   
z2PathAwareHookProxy.__getattr__.<locals>.fixed_hook)r#   r   r   r   )	getattrr   r   __dict__	functoolswrapsnamespec__name__)r   r    r+   r   r)   r   __getattr__1   s   

zPathAwareHookProxy.__getattr__N)r   r   r   r   )r   r   )r    r!   r   r"   )r2   
__module____qualname____doc__r   r   r3   r   r   r   r   r   "   s
    

r   )r
   r   r   r   r   r   )
__future__r   r.   pathlibr   typingr   r   r&   Zpluggycompatr   r   
deprecatedr	   r   __annotations__r   r   r   r   r   r   <module>   s$    
	