
    עi#'                    "   d Z ddlmZ ddl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j(                        ZddZ ej.                  d      dd       ZddZddZddZddZddZy)z3Version info, help messages, tracing configuration.    )annotationsN)	Generator)Sequence)Any)Config)ExitCode)	PrintHelp)Parser)TerminalReporterc                  V     e Zd ZdZdd	 	 	 	 	 	 	 d fdZ	 d	 	 	 	 	 	 	 	 	 ddZ xZS )	
HelpActiona2  An argparse Action that will raise a PrintHelp exception in order to skip
    the rest of the argument parsing when --help is passed.

    This prevents argparse from raising UsageError when `--help` is used along
    with 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.

    To opt in to this behavior, the parse caller must set
    `namespace._raise_print_help = True`. Otherwise it just sets the option.
    N)helpc               0    t         |   ||ddd|       y )Nr   TF)option_stringsdestnargsconstdefaultr   )super__init__)selfr   r   r   	__class__s       S/sites/domain-asset-master/.venv/lib/python3.12/site-packages/_pytest/helpconfig.pyr   zHelpAction.__init__"   s)     	) 	 	
    c                l    t        || j                  | j                         t        |dd      rt        y )N_raise_print_helpF)setattrr   r   getattrr	   )r   parser	namespacevaluesoption_strings        r   __call__zHelpAction.__call__.   s/     		499djj19159O :r   )r   zSequence[str]r   strr   
str | NonereturnNone)N)
r   zargparse.ArgumentParserr    zargparse.Namespacer!   zstr | Sequence[Any] | Noner"   r%   r&   r'   )__name__
__module____qualname____doc__r   r#   __classcell__)r   s   @r   r   r      sn    
 OS

+

36

AK

	

" %)
'
 &
 +	

 "
 

r   r   c           	     h   | 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       |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)r1   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`. See also --disable-plugin-autoload.)r1   r   r   metavarr   z--disable-plugin-autoload
store_trueFzDisable plugin auto-loading through entry point packaging metadata. Only plugins explicitly specified in -p or env var PYTEST_PLUGINS will be loaded.)r1   r   r   z--traceconfigz--trace-configz)Trace considerations of conftest.py filesz--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.)r1   r   r   r   r5   r   z-oz--override-inioverride_inizhOverride configuration option with "option=value" style, e.g. `-o strict_xfail=True -o cache_dir=cache`.)r   r1   r   )getgroup	addoption
_addoptionr   )r   groups     r   pytest_addoptionr@   ;   s   OOM*E	OOD   
7   
<  	 
OO#\	   
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 rF   )closesysstderrwriter4   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   )r&   r'   )optionr9   openrK   formatpytest__version__joinmapr$   rI   version_infoinvocation_paramsdirosgetcwdargsrL   rM   rN   pluginmanagerenable_tracingrJ   add_cleanup)pathrR   rO   rP   rQ   s     @@@r   pytest_cmdline_parserd   z   s    F}}}}""sW5	@@F""S#"2"234((,,		((--A		
 	##IOO4++::<

?vRHI	 	=)Ms   EE#c                    t         j                  j                  dt        j                   dt        j
                   d       t        |       }|r*|D ]$  }t         j                  j                  |dz          & yy)z<Show verbose pytest version installation, including plugins.zThis is pytest version z, imported from rF   N)rI   stdoutrK   rV   rW   __file__getpluginversioninfo)rO   
plugininfolines      r   show_version_verboserk      sm    JJ
!&"4"4!55EfooEVVXY &f-J 	*DJJTD[)	* r   c                   | j                   j                  dkD  rt        |        t        j                  S | j                   j
                  r;| j                          t        |        | j                          t        j                  S y )N   )	rS   r0   rk   r   OKr   _do_configureshowhelp_ensure_unconfigure)rO   s    r   pytest_cmdline_mainrr      sb     }}q V${{			""${{r   c                B   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                  |   \  }}	}
|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   terminalreporterzo[pytest] configuration options in the first pytest.toml|pytest.ini|tox.ini|setup.cfg|pyproject.toml file found:    z!help argument cannot be None for z (z):     F)initial_indentsubsequent_indentbreak_on_hyphens   )r{   rm   zEnvironment variables:)	)CIzlWhen set to a non-empty 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 internals)PYTEST_DEBUG_TEMPROOTz'Override the system temporary directory)PYTEST_THEMEz)The Pygments style to use for code output)PYTEST_THEME_MODEz3Set the PYTEST_THEME to be either 'dark' or 'light'z<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_twrK   _parser	optparserformat_helprj   	fullwidth_inidict	TypeErrorlenwrapstatsgetmessage)rO   r   reportertwcolumns
indent_lenindentr4   r   type_defaultspecspec_len	helplinesrj   wrappedvarswarningreports                     r   rp   rp      s   (.(<(<(G(G)H 	BHHV^^%%1134GGIGG	N GGIllGJ:F'' +%~~66t<dH<?vFGGr$r"
2dVt9zA~&GGI %"(!& & I "  HHSJ1A567mmD'J*>QVmWG
##ABK +DGGFTM*+7+< GGIGG$%D  (
d
"T#Jav&'(GGIGGIGG=>GG?@GG	 "++J; @
}444$?@r   c                   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 rw   )r`   list_plugin_distinfor2   r   reprproject_namer0   )rO   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: )rS   r9   traceconfigr2   rV   rW   rh   extendr`   list_name_pluginhasattrrg   r   )rO   r   verinfoitemsr4   r   rs          r   pytest_report_headerr     s    E}}fmm77~f&8&8%9:;&v.LL!}}  &'$$557! 	1LD&vz*OOLLL4SzA3/0	1 Lr   )r   r
   r&   r'   )r&   zGenerator[None, Config, Config])rO   r   r&   r'   )rO   r   r&   zint | ExitCode | None)rO   r   r&   z	list[str])r+   
__future__r   argparsecollections.abcr   r   r]   rI   typingr   _pytest.configr   r   r	   _pytest.config.argparsingr
   _pytest.terminalr   rV   Actionr   r@   hookimplrd   rk   rr   rp   rh   r    r   r   <module>r      s    9 "  % $ 	 
  ! # $ , - # #L<~  @*P@f	r   