관리-도구
편집 파일: doctest.cpython-312.opt-2.pyc
� �Q�f�� � �N � d Z g d�ZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlm Z mZ ddlmZ edd� Zi Zd� Z ed � Z ed � Z ed� Z ed� Z ed � Z ed� Zeez ez ez ez ez Z ed� Z ed� Z ed� Z ed� Z ed� Zeez ez ez ez Z dZ!dZ"d� Z#dVd�Z$d� Z%d� Z&dWd�Z'd� Z( G d� de � Z)d� Z*d� Z+d � Z, G d!� d"ejZ � Z.d#� Z/ G d$� d%� Z0 G d&� d'� Z1 G d(� d)� Z2 G d*� d+� Z3 G d,� d-� Z4 G d.� d/� Z5 G d0� d1e6� Z7 G d2� d3e6� Z8 G d4� d5e4� Z9da: dXd8�Z;d6ddddd6ddd7 e2� dfd9�Z< dYd:�Z=da>d;� Z? G d<� d=ej� � ZA G d>� d?eA� ZB G d@� dAej� � ZDdZdB�ZE G dC� dDeA� ZFd6dd e2� dfdE�ZGdF� ZHdG� ZIdH� ZJd[dI�ZKd[dJ�ZLd\dK�ZM G dL� dM� ZNeNdNdOdPdQdRdS�ZOdT� ZPeQdUk( r e j� eP� � yy)]zreStructuredText en)!�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS� FAIL_FAST�Example�DocTest� DocTestParser� DocTestFinder� DocTestRunner� OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples� testsource� debug_src�debug� N)�StringIO�IncrementalNewlineDecoder)� namedtuple�TestResultszfailed attemptedc �N � t j | dt t � z � S )N� )�OPTIONFLAGS_BY_NAME� setdefault�len)�names �./opt/alt/python312/lib64/python3.12/doctest.pyr r � s � ��)�)�$��S�9L�5M�0M�N�N� r r r r r r r r r r r z<BLANKLINE>z...c � � d}t j D ]6 }| j |d � }|t t |� u s�(||j z }�8 |S �Nr# )� __future__�all_feature_names�get�getattr� compiler_flag)�globs�flags�fname�features r. �_extract_future_flagsr; � sT � �� �E��-�-���)�)�E�4�(���g�j�%�0�0��W�*�*�*�E� .� �Lr/ c � � t j | � r| S t | t � rt | t � t � dg� S | �( t j t j |� S t d� �# t $ r6 t j t j |� j d cY S w xY w# t $ r Y y w xY w)N�*�__name__z"Expected a module, string, or None)�inspect�ismodule� isinstance�str� __import__�globals�locals�sys�modules�_getframemodulename�AttributeError� _getframe� f_globals�KeyError� TypeError)�module�depths r. �_normalize_modulerP � s� � �� ������ � �F�C� ��&�'�)�V�X��u�=�=� �� � O��{�{�3�#:�#:�5�#A�B�B� �<�=�=�� "� O��{�{�3�=�=��#7�#A�#A�*�#M�N�N� O��� �� �s* �%A= �=<B<�9B? �;B<�<B? �? C� Cc �: � t d d� j | d� S �NT)r% �decode)�datas r. �_newline_convertrU � s � �$�T�4�0�7�7��d�C�Cr/ c � � |ryt |d� }t || � } t |dd � x}� |j j }t |d� r/|j | � }|j |� }t |� | fS t | |�� 5 }|j � | fcd d d � S # t $ r Y �ow xY w# 1 sw Y y xY w)N� � __loader__�get_data)�encoding)rP �_module_relative_pathr5 �__spec__�loaderrI �hasattrrY rS rU �open�read)�filename�package�module_relativerZ r] � file_contents�fs r. �_load_testfilerf � s� � ��#�G�Q�/��(��(�;���g�|�T�:�:�F�C� � �)�)�0�0�� �6�:�&�"�O�O�H�5�M�)�0�0��:�M� $�M�2�H�<�<� �h�� *�a��v�v�x��!�"� "�� "� �� �� +� *�s �B% � B4�% B1�0B1�4B=c �8 � t j d|dz | � S )Nz (?m)^(?!$)� )�re�sub)�s�indents r. �_indentrm � s � �� �6�6�,��s� �A�.�.r/ c �v � t � }| \ }}}t j ||||�� |j � S )N)�file)r$ � traceback�print_exception�getvalue)�exc_info�excout�exc_type�exc_val�exc_tbs r. �_exception_tracebackrx � s= � �� �Z�F� (��H�g�v� ���h���f�E��?�?��r/ c � � e Zd Zd� Zdd�Zy)� _SpoofOutc �` � t j | � }|r|j d� s|dz }|S �N� )r$ rr �endswith)�self�results r. rr z_SpoofOut.getvalue s0 � ��"�"�4�(�� �&�/�/�$�/��d�N�F�� r/ Nc �P � | j |� t j | � y �N)�seekr$ �truncate)r �sizes r. r� z_SpoofOut.truncate s � �� � �$�����$�r/ r� )r>