
    9[g                        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dZ ej$                  d      	 	 	 	 	 	 dd       Z	 	 	 	 	 	 ddZ	 	 	 	 	 	 	 	 ddZ ej$                  d      dd       Zy
)    )annotations)	Generator)saferepr)Config)ExitCode)Parser)
FixtureDef)
SubRequest)ScopeNc                z    | j                  d      }|j                  dddd       |j                  dddd	       y )
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)parsergroups     L/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/setuponly.pypytest_addoptionr      sL    OOM*E	OO8	   
OO;	      T)wrapperc              #    K   	 d |j                   j                  j                  rt        |d      rj| j                  rKt        | j                        r| j	                  |j                        }n&| j                  |j                     }n|j                  }|| _        t        | |j                   d       S S # |j                   j                  j                  rt        |d      rj| j                  rKt        | j                        r| j	                  |j                        }n&| j                  |j                     }n|j                  }|| _        t        | |j                   d       w w xY ww)NparamSETUP)
configoption	setupshowhasattridscallabler   param_indexcached_param_show_fixture_action)
fixturedefrequestr   s      r   pytest_fixture_setupr'      s    F>>  **w( >>
/ *w}} = *w/B/B C#MME*/
' W^^WE +7>>  **w( >>
/ *w}} = *w/B/B C#MME*/
' W^^WE +s   E)B6 B/E)6B0E&&E)c                    | j                   J|j                  }|j                  j                  r't	        | |j                  d       t        | d      r| `y y y y )NTEARDOWNr#   )cached_resultr   r   r   r$   r   r#   )r%   r&   r   s      r   pytest_fixture_post_finalizerr+   5   sU     +=="" W^^ZHz>2+ 3 # ,r   c                ,   |j                   j                  d      }|r|j                          |j                         }|j	                          t        t        t                    j                  | j                        }|j                  d|z         |j                  dj                  |j                  d      | j                  d   j                         | j                               |dk(  rMt!        d | j"                  D              }|r/|j                  d	j                  d
j%                  |                   t'        | d      r*|j                  dt)        | j*                  d       d       |j-                          |r|j/                          y y )Ncapturemanagerz  z{step} {scope} {fixture}   r   )stepscopefixturer   c              3  ,   K   | ]  }|d k7  s	|  yw)r&   N ).0args     r   	<genexpr>z'_show_fixture_action.<locals>.<genexpr>U   s     M%8cC9<Lc%8s   
z (fixtures used: {})z, r#   [*   )maxsize])pluginmanager	getpluginsuspend_global_captureget_terminal_writerlinelistreversedr   index_scopewriteformatljustr0   upperargnamesortedargnamesjoinr   r   r#   flushresume_global_capture)r%   r   msgcapmantwscope_indentdepss          r   r$   r$   @   sG    !!++,<=F%%'		#	#	%BGGI(..z/@/@ALHHW|#$HH"))1""1%++-&& 	* 	
 g~MZ%8%8MMHH+22499T?CDz>*
1Xj55rBC1EFHHJ$$& r   )tryfirstc                R    | j                   j                  rd| j                   _        y )NT)r   	setuponlyr   )r   s    r   pytest_cmdline_mainrV   b   s    }}"&r   )r   r   returnNone)r%   FixtureDef[object]r&   r
   rW   zGenerator[None, object, object])r%   rY   r&   r
   rW   rX   )r%   rY   r   r   rN   strrW   rX   )r   r   rW   zint | ExitCode | None)
__future__r   typingr   _pytest._io.safereprr   _pytest.configr   r   _pytest.config.argparsingr   _pytest.fixturesr	   r
   _pytest.scoper   pytestr   hookimplr'   r+   r$   rV   r3   r   r   <module>rd      s    "  ) ! # , ' '    F"F-7F$F F*,",-7,	,'"',2'9<'	'D $  r   