관리-도구
편집 파일: pytester.cpython-311.pyc
� �܋f� � �� � d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddl#m$Z$ ddl%m&Z& ddl%m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddl.m0Z0 ddl.m1Z1 ddl2m3Z3 ddl2m4Z4 dd l2m5Z5 dd!l2m6Z6 dd"l2m7Z7 dd#l2m8Z8 dd$l9m:Z: dd%l;m<Z< dd&l=m>Z> dd'l=m?Z? dd(l@mAZA dd)lBmCZC dd*lDmEZE dd+lDmFZF dd,lGmHZH dd-lGmIZI dd.lGmJZJ dd/lKmLZL dd0lKmMZM dd1lKmNZN dd2lOmPZP dd3lOmQZQ dd4lRmSZS dd5lTmUZU e!rdd6lVmWZW dd7lVmXZX ddlYZYd8gZZd9gZ[d:e:d;dfd<�Z\d=e4d;dfd>�Z] G d?� d@� � Z^e>dAe?d;dBfdC�� � Z( G dD� dB� � Z_dEee` d;ee` fdF�Zae/ G dG� dH� � � � Zbe/ G dI� dJ� � � � Zce>dddL�� � Zd e>dM�N� � dAe?d;e dM fdO�� � Zee>dAe?dPeSdQeCd;dRfdS�� � Zfe>d;edT fdU�� � Zge>d;ee4ddf fdV�� � Zh e ji dW� � Zj e ji dX� � Zke/ G dY� dZ� � � � Zl G d[� d\� � Zm G d]� d^� � Zn G d_� d`� � Zoe/ G da� dR� � � � Zp G db� dK� � Zq G dc� dM� � ZrdS )ezZ(Disabled by default) support for testing pytest and pytest plugins. PYTEST_DONT_REWRITE � N)�fnmatch)�StringIO)�Path)�Any)�Callable)�Dict)� Generator)�IO)�Iterable)�List)�Optional)�overload)�Sequence)�TextIO)�Tuple)�Type)� TYPE_CHECKING)�Union)�WeakKeyDictionary)� IniConfig)�SectionWrapper)�timing)�Source)�_get_multicapture)�final)�NOTSET)� NotSetType)� _PluggyPlugin)�Config)�ExitCode)�hookimpl)�main)�PytestPluginManager)�Parser)�check_ispytest)�fixture)�FixtureRequest)�Session)�MonkeyPatch)� Collector)�Item)�fail)�importorskip)�skip)�bestrelpath)�copytree)�make_numbered_dir)� CollectReport)� TestReport)�TempPathFactory)� PytestWarning)�Final)�Literal�pytester_assertionsz/var/lib/sss/mc/passwd�parser�returnc � � | � ddddd�� � | � ddd d d�� � | � d d�� � d S )Nz--lsof� store_true�lsofFz"Run FD checks if lsof is available)�action�dest�default�help�--runpytest� inprocess� runpytest)rC � subprocesszYRun pytest sub runs in tests using an 'inprocess' or 'subprocess' (python -m main) method)r@ r? �choicesrA �pytester_example_dirz1Directory to take the pytester example files from)rA )� addoption�addini)r9 s �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/pytester.py�pytest_addoptionrK W s� � � ����� �� 1� � � � � ����� �+� 6� � � � � �M�M��%X� � � � � � � �configc �� � | � d� � r<t � � }|� � � r| j � |� � | � dd� � d S )Nr= �markerszlpytester_example_path(*path_segments): join the given path segments to `pytester_example_dir` for this test.)�getvalue�LsofFdLeakChecker�matching_platform� pluginmanager�register�addinivalue_line)rM �checkers rJ �pytest_configurerW p sv � � ���v��� 3�#�%�%���$�$�&�&� 3�� �)�)�'�2�2�2� ���� <�� � � � rL c � � e Zd Zdeeeef fd�Zdefd�Z e dd�� � de ded fd�� � Zd S ) rQ r: c � � t j dddt t j � � � � ft j t j ddt j d� � �� � j }dt dt fd �}g }|� d � � D ]x} ||� � rk|� d� � }|d d d � }|d d d � }|t v r�L|� d� � r|� ||f� � �y|S )Nr= z-Ffn0�-pTF)�stdout�stderr�check�text�encoding�liner: c �L � | � d� � od| vod| vod| vod| vS )N�f�deleted�mem�txt�cwd�� startswith)r` s rJ �isopenz0LsofFdLeakChecker.get_open_files.<locals>.isopen� sL � ��?�?�3�'�'� ���%� &���%�&���%�&� ��%� rL � � r � �/)rE �run�str�os�getpid�PIPE�DEVNULL�locale�getpreferredencodingr[ �bool�split� IGNORE_PAMrh �append)�self�outri � open_filesr` �fields�fd�filenames rJ �get_open_filesz LsofFdLeakChecker.get_open_files~ s! � ��n� �W�d�C�� ���$4�$4�5��?��%����0��7�7� � � � � � �� �� � � � � � ��I�I�d�O�O� 6� 6�D��v�d�|�|� 6����D�)�)���A�Y�q�r�r�]��!�!�9�Q�R�R�=���z�)�)���&�&�s�+�+� 6��%�%�r�8�n�5�5�5���rL c �n � t j dd�� � dS # t t j f$ r Y dS w xY w)N)r= z-vT)r] F)rE rn �OSError�CalledProcessError�rz s rJ rR z#LsofFdLeakChecker.matching_platform� sO � � ��N�>��6�6�6�6� �4�� ��6�7� � � ��5�5� ���s � �4�4T)�hookwrapper�tryfirst�item�NNNc # �& �K � | � � � }d V � t t d� � rt j � � | � � � }d� |D � � d� |D � � z ��fd�|D � � }|r�dt |� � z gd� |D � � �d�d� |D � � �d �d � |D � � �dt |� � z �d|j z �d�}|� t d � |� � � � � � d S d S )N�pypy_version_infoc � � h | ] }|d ��S �r � ��.0�ts rJ � <setcomp>z<LsofFdLeakChecker.pytest_runtest_protocol.<locals>.<setcomp>� s � �(�(�(�A�1�Q�4�(�(�(rL c � � h | ] }|d ��S r� r� r� s rJ r� z<LsofFdLeakChecker.pytest_runtest_protocol.<locals>.<setcomp>� s � �+A�+A�+A�Q�A�a�D�+A�+A�+ArL c �( �� g | ]}|d �v �|��S r� r� )r� r� �new_fdss �rJ � <listcomp>z=LsofFdLeakChecker.pytest_runtest_protocol.<locals>.<listcomp>� s"