%PDF- %PDF-
Direktori : /lib/python3.12/__pycache__/ |
Current File : //lib/python3.12/__pycache__/doctest.cpython-312.pyc |
� ���f� � �P � d Z dZg d�ZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl mZmZ 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� Z eez ez ez e z Z!dZ"dZ#d� Z$dWd�Z%d� Z&d� Z'dXd�Z(d� Z) G d� de� Z*d� Z+d � Z,d!� Z- G d"� d#ej\ � Z/d$� Z0 G d%� d&� Z1 G d'� d(� Z2 G d)� d*� Z3 G d+� d,� Z4 G d-� d.� Z5 G d/� d0� Z6 G d1� d2e7� Z8 G d3� d4e7� Z9 G d5� d6e5� Z:da; dYd9�Z<d7ddddd7ddd8 e3� dfd:�Z= dZd;�Z>da?d<� Z@ G d=� d>ej� � ZB G d?� d@eB� ZC G dA� dBej� � ZEd[dC�ZF G dD� dEeB� ZGd7dd e3� dfdF�ZHdG� ZIdH� ZJdI� ZKd\dJ�ZLd\dK�ZMd]dL�ZN G dM� dN� ZOeOdOdPdQdRdSdT�ZPdU� ZQeRdVk( r e j� eQ� � yy)^a� Module doctest -- a framework for running examples in docstrings. In simplest use, end each module M to be tested with: def _test(): import doctest doctest.testmod() if __name__ == "__main__": _test() Then running the module as a script will cause the examples in the docstrings to get executed and verified: python M.py This won't display anything unless an example fails, in which case the failing example(s) and the cause(s) of the failure(s) are printed to stdout (why not stderr? because stderr is a lame hack <0.2 wink>), and the final line of output is "Test failed.". Run it with the -v switch instead: python M.py -v and a detailed report of all examples tried is printed to stdout, along with assorted summaries at the end. You can force verbose mode by passing "verbose=True" to testmod, or prohibit it by passing "verbose=False". In either of those cases, sys.argv is not examined by testmod. There are a variety of other ways to run doctests, including integration with the unittest framework, and support for running non-Python text files containing doctests. There are also many ways to override parts of doctest's default behaviors. See the Library Reference Manual for details. 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 �/usr/lib/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 )z� Return the compiler-flags associated with the future features that have been imported into the given namespace (globs). r# N)� __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 yw xY w)a� Return the module specified by `module`. In particular: - If `module` is a module, then return module. - If `module` is a string, then import and return the module with that name. - If `module` is None, then return the calling module. The calling module is assumed to be the module of the stack frame at the given depth in the call stack. �*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_modulerO � s� � � ������ � �F�C� ��&�'�)�V�X��u�=�=� �� � O��{�{�3�#:�#:�5�#A�B�B� �<�=�=�� "� O��{�{�3�=�=��#7�#A�#A�*�#M�N�N� O��� �� �s* �%A<