
    yIf              
          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l	m
Z
 d dlmZ d d	lmZ d d
lmZ d dlZde
ddfdZ ej        d          dee         dededeef         fd            Zdee         deddfdZdee         dededdfdZ ej        d          dedeeeef                  fd            ZdS )    )	Generator)Optional)Union)saferepr)Config)ExitCode)Parser)
FixtureDef)
SubRequest)ScopeNparserreturnc                     |                      d          }|                    dddd           |                    dddd	           d S )
Ndebugconfigz--setuponlyz--setup-only
store_truez)Only setup fixtures, do not execute tests)actionhelpz--setupshowz--setup-showz,Show setup of fixtures while executing tests)getgroup	addoption)r   groups     E/var/www/piapp/venv/lib/python3.11/site-packages/_pytest/setuponly.pypytest_addoptionr      sm    OOM**E	OO8	     
OO;	          T)wrapper
fixturedefrequestc              #   V  K   	 d V |j         j        j        r~t          |d          rW| j        rBt          | j                  r|                     |j                  }n| j        |j                 }n|j        }|| _        t          | |j         d           S S # |j         j        j        r~t          |d          rW| j        rBt          | j                  r|                     |j                  }n| j        |j                 }n|j        }|| _        t          | |j         d           w w xY w)NparamSETUP)
configoption	setupshowhasattridscallabler   param_indexcached_param_show_fixture_action)r   r   r   s      r   pytest_fixture_setupr)      s>     F> * 	Fw(( 
0 > *
// D *w} = = *w/B C#ME*/
' W^WEEEE	F7> * 	Fw(( 
0 > *
// D *w} = = *w/B C#ME*/
' W^WEEEE	Fs   B BD(c                     | j         =|j        }|j        j        r,t	          | |j        d           t          | d          r| `d S d S d S d S )NTEARDOWNr'   )cached_resultr    r!   r"   r(   r#   r'   )r   r   r    s      r   pytest_fixture_post_finalizerr-   5   so     +=" 	, W^ZHHHz>22 ,+++ ,+	, 	,, ,r   r    msgc                    |j                             d          }|r|                                 |                                }|                                 t          t          t                                                  | j	                  }|
                    d|z             |
                    d                    |                    d          | j        d                                         | j                             |dk    r[t!          d | j        D                       }|r;|
                    d	                    d
                    |                               t'          | d          r-|
                    dt)          | j        d           d           |                                 |r|                                 d S d S )Ncapturemanagerz  z{step} {scope} {fixture}   r   )stepscopefixturer   c              3   &   K   | ]}|d k    |V  dS )r   N ).0args     r   	<genexpr>z'_show_fixture_action.<locals>.<genexpr>U   s,      MMcC9<L<Lc<L<L<L<LMMr   z (fixtures used: {})z, r'   [*   )maxsize])pluginmanager	getpluginsuspend_global_captureget_terminal_writerlinelistreversedr   index_scopewriteformatljustr3   upperargnamesortedargnamesjoinr#   r   r'   flushresume_global_capture)r   r    r.   capmantwscope_indentdepss          r   r(   r(   @   s    !++,<==F (%%'''		#	#	%	%BGGIII((..z/@AALHHW|#$$$HH"))1"1%++--& 	* 	
 	
   g~~MMZ%8MMMMM 	EHH+22499T??CCDDDz>** G
EXj5rBBBEEEFFFHHJJJ '$$&&&&&' 'r   )tryfirstc                 6    | j         j        rd| j         _        d S )NT)r!   	setuponlyr"   )r    s    r   pytest_cmdline_mainrX   b   s    } '"&4r   )typingr   r   r   _pytest._io.safereprr   _pytest.configr   r   _pytest.config.argparsingr	   _pytest.fixturesr
   r   _pytest.scoper   pytestr   hookimplobjectr)   r-   strr(   intrX   r6   r   r   <module>rd      s                     ) ) ) ) ) ) ! ! ! ! ! ! # # # # # # , , , , , , ' ' ' ' ' ' ' ' ' ' ' '       V       F6"F-7FtVV#$F F F F*,6",-7,	, , , ,'6"',2'9<'	' ' ' 'D $ 8E#x-4H+I       r   