????

Your IP : 3.147.70.194


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/stepwise.cpython-311.pyc

�

�܋fj����ddlmZddlmZddlmZddlZddlmZddlmZddl	m
Z
ddlmZdd	l
mZerdd
lmZdZde
d
dfd�Zejded
dfd���Zded
dfd�ZGd�d��ZdS)�)�List)�Optional)�
TYPE_CHECKINGN)�nodes)�Config)�Parser)�Session)�
TestReport)�Cachezcache/stepwise�parser�returnc��|�d��}|�dddddd���|�d	d
dddd���dS)
N�generalz--swz
--stepwise�
store_trueF�stepwisezBExit on test failure and continue from last failing test next time)�action�default�dest�helpz	--sw-skipz--stepwise-skip�
stepwise_skipz_Ignore the first failing test but stop on the next failing test. Implicitly enables --stepwise.)�getgroup�	addoption)r�groups  �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/stepwise.py�pytest_addoptionrs{���O�O�I�&�&�E�	�O�O�����
�
Q�
����
�O�O�����
�)�
�������configc��|jjrd|j_|�d��r*|j�t
|��d��dSdS)NTr�stepwiseplugin)�optionrr�	getoption�
pluginmanager�register�StepwisePlugin)rs r�pytest_configurer%'sd��
�}�"�&�!%��
��
���
�#�#�P���%�%�n�V�&<�&<�>N�O�O�O�O�O�P�Pr�sessionc���|j�d��sL|jj�J�t|jd��rdS|jj�t
g��dSdS)Nr�workerinput)rr!�cache�hasattr�set�STEPWISE_CACHE_DIR�r&s r�pytest_sessionfinishr.0sr���>�#�#�J�/�/�9��~�#�/�/�/��7�>�=�1�1�	�
�F���� � �!3�R�8�8�8�8�8�9�9rc��eZdZdeddfd�Zdeddfd�Zdedeej	ddfd�Z
d	eddfd
�Zde
efd�Zd
d�ZdS)r$rr
Nc���||_d|_d|_|j�J�|j|_|j�t
d��|_|�d��|_dS)N�r)	rr&�
report_statusr)�getr,�
lastfailedr!�skip)�selfrs  r�__init__zStepwisePlugin.__init__<s`�����*.�������|�'�'�'�"�L��
�)-����8J�D�)Q�)Q��� �*�*�?�;�;��	�	�	rr&c��||_dS)Nr-)r6r&s  r�pytest_sessionstartz"StepwisePlugin.pytest_sessionstartEs
������r�itemsc��|js	d|_dSd}t|��D]\}}|j|jkr|}n�|�	d|_dSd|�d�|_|d|�}|d|�=|j�|���dS)Nz)no previously failed tests, not skipping.z/previously failed test not found, not skipping.z	skipping z already passed items.)r:)r4r2�	enumerate�nodeid�hook�pytest_deselected)r6rr:�failed_index�index�item�
deselecteds       r�pytest_collection_modifyitemsz,StepwisePlugin.pytest_collection_modifyitemsHs�����	�!L�D���F���$�U�+�+�	�	�K�E�4��{�d�o�-�-�$����.���!R�D����!Q�\�!Q�!Q�!Q�D���}��}�-�J��m�|�m�$��K�)�)�
�)�;�;�;�;�;r�reportc���|jrJ|jr |j|jkrd|_d|_dS|j|_|j�J�d|j_dS|jdkr|j|jkrd|_dSdSdS)NFz0Test failed, continuing from this test next run.�call)�failedr5r=r4r&�
shouldstop�when)r6rEs  r�pytest_runtest_logreportz'StepwisePlugin.pytest_runtest_logreport`s����=�	+��y�

��=�D�O�3�3�&*�D�O�!��	�	�	�#)�-����|�/�/�/�F���'�'�'��{�f�$�$��=�D�O�3�3�&*�D�O�O�O�%�$�3�3rc�d�|j�d��dkr|jr
d|j��SdS)N�verboserz
stepwise: )rr!r2�r6s r�pytest_report_collectionfinishz-StepwisePlugin.pytest_report_collectionfinishxs;���;� � ��+�+�q�0�0�T�5G�0�4�� 2�4�4�4��trc�~�t|jd��rdS|j�t|j��dS)Nr()r*rr)r+r,r4rNs rr.z#StepwisePlugin.pytest_sessionfinish}s<���4�;�
�.�.�	�
�F��
���)�4�?�;�;�;�;�;r)r
N)�__name__�
__module__�__qualname__rr7r	r9rr�ItemrDr
rKr�strrOr.�rrr$r$;s�������<�v�<�$�<�<�<�<��7��t�����<��<�%)�%�*�%5�<�	
�<�<�<�<�0+�z�+�d�+�+�+�+�0���
�����
<�<�<�<�<�<rr$)�typingrrr�pytest�_pytestr�_pytest.configr�_pytest.config.argparsingr�_pytest.mainr	�_pytest.reportsr
�_pytest.cacheproviderrr,r�hookimplr%r.r$rVrr�<module>r`st�������������� � � � � � �
�
�
�
�������!�!�!�!�!�!�,�,�,�,�,�,� � � � � � �&�&�&�&�&�&��,�+�+�+�+�+�+�%���V�������*��P�V�P��P�P�P���P�9�'�9�d�9�9�9�9�G<�G<�G<�G<�G<�G<�G<�G<�G<�G<r