관리-도구
편집 파일: helpconfig.cpython-311.pyc
� �܋fZ! � �l � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddl Z ddl mZ ddl mZ dd l m Z dd lmZ G d� de� � Zd eddfd�Z e j d�� � d� � � Zdeddfd�Zdedeeeef fd�Zdeddfd�ZdgZdedee fd�Zdedee fd�ZdS )z3Version info, help messages, tracing configuration.� N)�Action)�List)�Optional)�Union)�Config)�ExitCode)� PrintHelp)�Parserc �, � � e Zd ZdZd� fd� Zdd�Z� xZS )� 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. NFc �V �� t � � � ||d|d|�� � d S )NTr )�option_strings�dest�const�default�nargs�help)�super�__init__)�selfr r r r � __class__s ��c/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/helpconfig.pyr zHelpAction.__init__ s@ �� � �����)������ � � � � � � c �v � t || j | j � � t |j dd� � rt �d S )N�after_preparseF)�setattrr r �getattr�_parserr )r �parser� namespace�values� option_strings r �__call__zHelpAction.__call__$ s@ � �� �4�9�d�j�1�1�1� �6�>�#3�U�;�;� ��O� � r )NFN)N)�__name__� __module__�__qualname__�__doc__r r# � __classcell__)r s @r r r s[ �� � � � � �� � � � � � � �� � � � � � � r r r �returnc �z � | � d� � }|� dddddd�� � |� d d t dd� � � |� dddg dd�� � |� ddddd�� � |� ddddddd �!� � |� d"d#d$dd%�&� � d S )'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�namez�Early-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�?zpytestdebug.log�debug�DEBUG_FILE_NAMEz�Store 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 r2 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> � ��O�O�M�*�*�E� �O�O����� �D� � � � � ������ � 7� � � � � ����� ���� � � � � �O�O����� 8� � � � � �O�O����� �!�$� � � � � ����� ��:� � � � � � r T)�hookwrapperc # � ���K � d V �} | � � � ��j j �r�j j }t |dd�� � ��� dt j �dd� t t t j � � � � �dt j � � �d�j j �d � � � �j j � �j � � �j � � � �t j � d |z � � d ���fd�}�� |� � d S d S )N�wzutf-8)�encodingzversions pytest-z , python-�.z cwd=z args=z z'writing pytest debug information to %s r) c �� �� �� � � t j � d�j z � � � j j � d � � �� � d S )Nz%wrote pytest debug information to %s )�close�sys�stderr�writer1 �trace�root� setwriter)�config� debugfile�undo_tracings ���r � unset_tracingz+pytest_cmdline_parse.<locals>.unset_tracing{ sY �� ��O�O�����J���E� ��V�W�W�W��L��'�'��-�-�-��L�N�N�N�N�Nr )r) N)� get_result�optionr6 �openrG �pytest�__version__�join�map�strrE �version_info�os�getcwd�invocation_params�argsrH rI rJ � pluginmanager�enable_tracingrF �add_cleanup)�outcome�pathrN rK rL rM s @@@r �pytest_cmdline_parsera d sR ���� � � ��e�e�G��'�'�)�)�F� �}�� *��}�"����s�W�5�5�5� ����� �"�"�"�����S�#�"2�3�3�4�4�4�4�� ������(�-�-�-� � � � � ���#�#�I�O�4�4�4��+�:�:�<�<��� ���C�d�J�K�K�K� � � � � � � � � ���=�)�)�)�)�)�1*� *r rK c � � | j j dk r�t j � d� t j t j � � � � t | � � }|r'|D ]&}t j � |dz � � �%d S d S t j � dt j � d�� � d S )N� z,This is pytest version {}, imported from {} � zpytest ) rP r- rE �stdoutrG �formatrR rS �__file__�getpluginversioninfo)rK � plugininfo�lines r �showversionrk � s� � � �}��q� � �� ���;�B�B��"�F�O� � � � � � *�&�1�1� �� .�"� .� .��� � � ����-�-�-�-� .� .� .� .� � ���9�6�#5�9�9�9�:�:�:�:�:r c �� � | j j dk rt | � � dS | j j r9| � � � t | � � | � � � dS d S )Nr )rP r- rk r � _do_configure�showhelp�_ensure_unconfigure)rK s r �pytest_cmdline_mainrp � sn � � �}��q� � ��F�����q� �� � �������������"�"�$�$�$��q��4r c � � dd l }| j � d� � }|j }|� | j j � � � � � |� � � |� d� � |� � � |j }d}d|z }| j j D �]-}| j j | \ }} } | �d} |�t d|� �� � �|� d| � d �}|� d |z � � t |� � }||dz k rI|� � � |� ||||d� � � } | D ]}|� |� � ���|� d||z dz z � � |� |||z d�� � }|r@|� |d � � |dd � D ]}|� ||z � � ���/|� � � |� d� � g d�}|D ]!\ }}|� d|d�d|� �� � �"|� � � |� � � |� d� � |� d� � |� d� � |j � dg � � D ]!}|� d|j z d�� � �"d S )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):z %s� F)�initial_indent�subsequent_indent�break_on_hyphens� )ry rc zEnvironment variables:))�PYTEST_ADDOPTSzExtra 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� 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�_twrG r � optparser�format_helprj � fullwidth� _ininames�_inidict� TypeError�len�wrap�stats�get�message)rK r� �reporter�tw�columns� indent_len�indentr1 r �typer �spec�spec_len� helplinesrj �wrapped�vars� warningreports r rn rn � s/ � ��O�O�O��#�.�.�/A�B�B�H� ��B��H�H�V�^� %� 1� 1� 3� 3�4�4�4��G�G�I�I�I��G�G� B�� � � �G�G�I�I�I��l�G��J� �:� �F���(� +� +��$�n�5�d�;���d�G��<��D��<��F��F�F�G�G�G��"�"�$�"�"�"�� ����$������t�9�9���z�A�~�&�&��G�G�I�I�I� � � ���%�"(�!&� &� � �I� "� � ������ � � � � � �H�H�S�J��1�A�5�6�7�7�7��m�m�D�'�J�*>�QV�m�W�W�G�� +������ �#�#�#�#�A�B�B�K� +� +�D��G�G�F�T�M�*�*�*�*���G�G�I�I�I��G�G�$�%�%�%�� � �D� � (� (� ��d� ���&�T�&�&�&��&�&�'�'�'�'��G�G�I�I�I��G�G�I�I�I��G�G�=�>�>�>��G�G�?�@�@�@��G�G� �� � � "��+�+�J��;�;� @� @� � ����}�4�4�$��?�?�?�?� �Fr )�pytest_pluginszlist of plugin names to loadc � � g }| j � � � }|rg|� d� � |D ]O\ }}t |dt |� � � � }|j � d|j � d|� �}|� d|z � � �P|S )Nzsetuptools registered plugins:rg �-z at r )r\ �list_plugin_distinfor/ r �repr�project_namer- )rK �linesri �plugin�dist�loc�contents r rh rh � s� � ��E��%�:�:�<�<�J�� )� ���5�6�6�6�&� )� )�L�F�D��&�*�d�6�l�l�;�;�C��*�D�D�T�\�D�D�s�D�D�G��L�L����(�(�(�(��Lr c �� � g }| j j s| j j rH|� dt j � �� � t | � � }|r|� |� � | j j ry|� d� � | j � � � }|D ]H\ }}t |d� � r|j }nt |� � }|� d|d�d|� �� � �I|S )Nzusing: pytest-zactive plugins:rg z z<20z: ) rP r6 �traceconfigr/ rR rS rh �extendr\ �list_name_plugin�hasattrrg r� )rK r� �verinfo�itemsr1 r� �rs r �pytest_report_headerr� � s � ��E� �}�� "�f�m�7� "� ���:�f�&8�:�:�;�;�;�&�v�.�.��� "��L�L��!�!�!� �}� � 1� ���&�'�'�'��$�5�5�7�7��!� 1� 1�L�D�&��v�z�*�*� !��O�����L�L���L�L�/��/�/�/�A�/�/�0�0�0�0��Lr )r'