
    9[g"                        d 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l	mZ dd	lmZ dd
lmZ ddlZ G d de      ZddZ ej(                  d      dd       ZddZddZddZdgZddZddZy)z3Version info, help messages, tracing configuration.    )annotations)ActionN)	Generator)Config)ExitCode)	PrintHelp)Parser)TerminalReporterc                  ,     e Zd ZdZd fd	ZddZ xZS )
HelpActiona}  An argparse Action that will raise an exception in order to skip the
    rest of the argument parsing when --help is passed.

    This prevents argparse from quitting due to missing required arguments
    when any are defined, for example by ``pytest_addoption``.
    This is similar to the way that the builtin argparse --help option is
    implemented by raising SystemExit.
    c                0    t         |   ||d|d|       y )NTr   )option_stringsdestconstdefaultnargshelp)super__init__)selfr   r   r   r   	__class__s        M/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/helpconfig.pyr   zHelpAction.__init__   s'    ) 	 	
    c                    t        || j                  | j                         t        |j                  dd      rt
        y )Nafter_preparseF)setattrr   r   getattr_parserr   )r   parser	namespacevaluesoption_strings        r   __call__zHelpAction.__call__'   s3    	499djj1 6>>#3U;O <r   )NFN)N)__name__
__module____qualname____doc__r   r#   __classcell__)r   s   @r   r   r      s    
r   r   c           	     >   | j                  d      }|j                  dddddd       |j                  d	d
t        dd       |j                  dddg dd       |j                  ddddd       |j                  ddddddd !       |j                  d"d#d$dd%&       y )'Ndebugconfigz	--versionz-Vcountr   versionzoDisplay pytest version and information about plugins. When given twice, also display information about plugins.)actionr   r   r   z-hz--helpr   z(Show help message and configuration info)r-   r   r   z-pappendpluginsnamezEarly-load given plugin module name or entry point (multi-allowed). To avoid loading of plugins, use the `no:` prefix, e.g. `no:doctest`.)r-   r   r   metavarr   z--traceconfigz--trace-config
store_trueFz)Trace considerations of conftest.py files)r-   r   r   z--debugstore?zpytestdebug.logdebugDEBUG_FILE_NAMEzStore internal tracing debug information in this log file. This file is opened with 'w' and truncated as a result, care advised. Default: pytestdebug.log.)r-   r   r   r   r1   r   z-oz--override-inioverride_iniz^Override ini option with "option=value" style, e.g. `-o xfail_strict=True -o cache_dir=cache`.)r   r-   r   )getgroup	addoption
_addoptionr   )r   groups     r   pytest_addoptionr<   /   s    OOM*E	OOD   
7   
  	 
OO8   
OO!$  
 
:  r   T)wrapperc               #    K   d j                   j                  r@j                   j                  } t        | dd      j                  dj	                  t
        j                  dj                  t        t        t        j                              j                  j                  t        j                         j                  j                                j"                  j$                  j'                  j                         j(                  j+                         t        j,                  j                  d|  d       d	fd}j/                  |       S w)
Nwzutf-8)encodingz@versions pytest-{}, python-{}
invocation_dir={}
cwd={}
args={}

.z$writing pytest debug information to 
c                     j                          t        j                  j                  dj                   d        j
                  j                  j                  d                 y )Nz"wrote pytest debug information to rB   )closesysstderrwriter0   traceroot	setwriter)config	debugfileundo_tracings   r   unset_tracingz+pytest_cmdline_parse.<locals>.unset_tracing}   sL    OOJJA)..AQQSTULL''-Nr   )returnNone)optionr5   openrG   formatpytest__version__joinmapstrrE   version_infoinvocation_paramsdirosgetcwdargsrH   rI   rJ   pluginmanagerenable_tracingrF   add_cleanup)pathrN   rK   rL   rM   s     @@@r   pytest_cmdline_parserc   g   s    F}}}}""sW5	@@F""S#"2"234((,,		((--A		
 	##IOO4++::<

?vRHI	 	=)Ms   EE#c                   | j                   j                  dkD  rzt        j                  j	                  dt
        j                   dt
        j                   d       t        |       }|r*|D ]$  }t        j                  j	                  |dz          & y y t        j                  j	                  dt
        j                   d       y )N   zThis is pytest version z, imported from rB   zpytest )	rQ   r,   rE   stdoutrG   rT   rU   __file__getpluginversioninfo)rK   
plugininfolines      r   showversionrk      s    }}q 

%f&8&8%99I&//IZZ\]	
 *&1
"

  - #  	

76#5#5"6b9:r   c                    | j                   j                  dkD  rt        |        y| j                   j                  r,| j	                          t        |        | j                          yy )Nr   )rQ   r,   rk   r   _do_configureshowhelp_ensure_unconfigure)rK   s    r   pytest_cmdline_mainrp      sR    }}q F			""$r   c                J   dd l }| j                  j                  d      }|J |j                  }|j	                  | j
                  j                  j                                |j                          |j                  d       |j                          |j                  }d}d|z  }| j
                  j                  D ]  }| j
                  j                  |   \  }}	}
|	d}	|t        d|       | d|	 d	}|j	                  d
|        t        |      }||dz
  kD  r?|j                          |j                  ||||d      }|D ]  }|j                  |        |j	                  d||z
  dz
  z         |j                  |||z
  d      }|s|j                  |d          |dd  D ]  }|j                  ||z            |j                          |j                  d       g d}|D ]  \  }}|j                  d
|dd|         |j                          |j                          |j                  d       |j                  d       |j                  d       |j                  j!                  dg       D ]"  }|j                  d|j"                  z   d       $ y )Nr   terminalreporterzY[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:    stringz!help argument cannot be None for z (z):     F)initial_indentsubsequent_indentbreak_on_hyphens   )rz   re   zEnvironment variables:))CIzmWhen set (regardless of value), pytest knows it is running in a CI process and does not truncate summary info)BUILD_NUMBERzEquivalent to CI)PYTEST_ADDOPTSzExtra command line options)PYTEST_PLUGINSz.Comma-separated plugins to load during startup)PYTEST_DISABLE_PLUGIN_AUTOLOADz"Set to disable plugin auto-loading)PYTEST_DEBUGz1Set to enable debug tracing of pytest's internalsz<24z/to see available markers type: pytest --markersz1to see available fixtures type: pytest --fixturesz(shown according to specified file_or_dir or current dir if not specified; fixtures with leading '_' are only shown with the '-v' optionwarningsz
warning : T)red)textwrapr_   
get_plugin_twrG   r   	optparserformat_helprj   	fullwidth	_ininames_inidict	TypeErrorlenwrapstatsgetmessage)rK   r   reportertwcolumns
indent_lenindentr0   r   typer   specspec_len	helplinesrj   wrappedvarswarningreports                     r   rn   rn      s   (.(<(<(G(G)H 	BHHV^^%%1134GGIGG	B GGIllGJ:F(($nn55d;dG<D<?vFGGr$r"
2dVt9zA~&GGI %"(!& & I " " HHSJ1A567mmD'J*>QVmWG
##ABKDGGFTM* (; )@ GGIGG$%D 
d
"T#Jav&' GGIGGIGG=>GG?@GG	 "++J;
}444$? <r   )pytest_pluginszlist of plugin names to loadc                   g }| j                   j                         }|rc|j                  d       |D ]M  \  }}t        |dt	        |            }|j
                   d|j                   d| }|j                  d|z          O |S )Nzregistered third-party plugins:rg   -z at rv   )r_   list_plugin_distinfor.   r   reprproject_namer,   )rK   linesri   plugindistloccontents          r   rh   rh      s    E%%::<J67&LFD&*d6l;C**+1T\\N$seDGLL( ' Lr   c                   g }| j                   j                  s| j                   j                  r@|j                  dt        j
                          t        |       }|r|j                  |       | j                   j                  rq|j                  d       | j                  j                         }|D ]A  \  }}t        |d      r|j                  }nt        |      }|j                  d|dd|        C |S )Nzusing: pytest-zactive plugins:rg   z    z<20z: )rQ   r5   traceconfigr.   rT   rU   rh   extendr_   list_name_pluginhasattrrg   r   )rK   r   verinfoitemsr0   r   rs          r   pytest_report_headerr     s    E}}fmm77~f&8&8%9:;&v.LL!}}  &'$$557!LD&vz*OOLLL4SzA3/0 " Lr   )r   r	   rO   rP   )rO   zGenerator[None, Config, Config])rK   r   rO   rP   )rK   r   rO   zint | ExitCode | None)rK   r   rO   z	list[str])r'   
__future__r   argparser   r\   rE   typingr   _pytest.configr   r   r   _pytest.config.argparsingr	   _pytest.terminalr
   rT   r   r<   hookimplrc   rk   rp   rn   conftest_optionsrh   r    r   r   <module>r      s    9 "  	 
  ! # $ , -  85p  @
;	O@d GG 	r   