a
    *ñ»j“f  ã                   @  s’  U d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlZddlZddlZdd	lmZ ddlZddlZddlZddlZddlZdd
lmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl'm)Z) ddl*m+Z+ ddl*m,Z, ddl-m.Z. ddl-m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 e�r´ddl8Z8ddl9m:Z: dZ;d Z<d!Z=d"Z>d#Z?e;e<e=e>e?fZ@daAdaBd$eCd%< d&d'd(œd)d*„ZDd'd+œd,d-„ZEd.d/d0d1œd2d3„ZFd.d4d5œd6d7„ZGd8d.d/d4d9œd:d;„ZHd.d4d5œd<d=„ZIG d>d?„ d?eƒZJG d@dA„ dAeKƒZLdBd+œdCdD„ZMd{dFdGdHd4dIdJœdKdL„ZNG dMdN„ dNe,ƒZOdOd+œdPdQ„ZPd8dHdRœdSdT„ZQd8d4dRœdUdV„ZRG dWdX„ dXe3ƒZSdYd'dZœd[d\„ZTd]d4d^œd_d`„ZUe
dad+œdbdc„ƒZVG ddde„ dee3ƒZWdfd+œdgdh„ZXdid+œdjdk„ZYdHd+œdldm„ZZdHd+œdndo„Z[dHd+œdpdq„Z\drdHdsœdtdu„Z]e(dvdw�dxd+œdydz„ƒZ^dS )|z4Discover and run doctests in modules and test files.é    )ÚannotationsN)ÚCallable)Ú	Generator)ÚIterable)ÚSequence)Úcontextmanager)ÚPath)ÚAny)ÚTYPE_CHECKING)Úoutcomes)ÚExceptionInfo)ÚReprFileLocation)ÚTerminalRepr)ÚTerminalWriter©Úsafe_getattr)ÚConfig)ÚParser)Úfixture)Ú
TopRequest)Ú	Collector)ÚItem)ÚOutcomeException)Úskip©Ú
fnmatch_ex)ÚModule)Úapprox)ÚPytestWarning)ÚSelfÚnoneZcdiffZndiffÚudiffZonly_first_failurez"type[doctest.OutputChecker] | NoneÚCHECKER_CLASSr   ÚNone)ÚparserÚreturnc                 C  sœ   | j ddddgd� | j dddd	� |  d
¡}|jdddddd� |jdtjddtdd� |jddg dddd� |jdddddd� |jdddd d!d� d S )"NÚdoctest_optionflagszOption flags for doctestsÚargsÚELLIPSIS)ÚtypeÚdefaultÚdoctest_encodingzEncoding used for doctest fileszutf-8)r*   Úcollectz--doctest-modulesÚ
store_trueFzRun doctests in all .py modulesÚdoctestmodules)Úactionr*   ÚhelpÚdestz--doctest-reportr!   z9Choose another output format for diffs on doctest failureÚdoctestreport)r)   r*   r0   Úchoicesr1   z--doctest-globÚappendÚpatz2Doctests file matching pattern, default: test*.txtÚdoctestglob)r/   r*   Úmetavarr0   r1   z--doctest-ignore-import-errorsz Ignore doctest collection errorsÚdoctest_ignore_import_errorsz--doctest-continue-on-failurez<For a given doctest, continue to run after the first failureÚdoctest_continue_on_failure)ZaddiniZgetgroupZ	addoptionÚstrÚlowerÚDOCTEST_REPORT_CHOICES)r$   Úgroup© r>   ú5E:\soccer\ml_env\Lib\site-packages\_pytest/doctest.pyÚpytest_addoptionF   s^    üÿ
ûúúûûr@   ©r%   c                   C  s   d a d S ©N)ÚRUNNER_CLASSr>   r>   r>   r?   Úpytest_unconfigurex   s    rD   r   r   z&DoctestModule | DoctestTextfile | None)Ú	file_pathÚparentr%   c                 C  sZ   |j }| jdkr<|jjrVtt| ƒt| ƒfƒsVtj|| d�S nt	|| |ƒrVt
j|| d�S d S )Nz.py©Úpath)ÚconfigÚsuffixÚoptionr.   ÚanyÚ_is_setup_pyÚ_is_main_pyÚDoctestModuleÚfrom_parentÚ_is_doctestÚDoctestTextfile)rE   rF   rI   r>   r>   r?   Úpytest_collect_file~   s    

ÿrS   Úbool)rH   r%   c                 C  s&   | j dkrdS |  ¡ }d|v p$d|v S )Nzsetup.pyFs
   setuptoolss	   distutils)ÚnameÚ
read_bytes)rH   Úcontentsr>   r>   r?   rM   �   s    
rM   r   )rI   rH   rF   r%   c                   s@   ˆ j dv r|j ˆ ¡rdS |  d¡p(dg}t‡ fdd„|D ƒƒS )N)z.txtz.rstTr6   z	test*.txtc                 3  s   | ]}t |ˆ ƒV  qd S rB   r   )Ú.0ÚglobrG   r>   r?   Ú	<genexpr>˜   ó    z_is_doctest.<locals>.<genexpr>)rJ   ÚsessionZ
isinitpathÚ	getoptionrL   )rI   rH   rF   Úglobsr>   rG   r?   rQ   ”   s    rQ   c                 C  s
   | j dkS )Nz__main__.py)rU   rG   r>   r>   r?   rN   ›   s    rN   c                   @  s,   e Zd Zdddœdd„Zdddœdd	„Zd
S )ÚReprFailDoctestz0Sequence[tuple[ReprFileLocation, Sequence[str]]]r#   )Úreprlocation_linesr%   c                 C  s
   || _ d S rB   )r`   )Úselfr`   r>   r>   r?   Ú__init__    s    zReprFailDoctest.__init__r   )Útwr%   c                 C  s2   | j D ]&\}}|D ]}| |¡ q| |¡ qd S rB   )r`   ÚlineÚ
toterminal)ra   rc   ÚreprlocationÚlinesrd   r>   r>   r?   re   ¥   s    zReprFailDoctest.toterminalN)Ú__name__Ú
__module__Ú__qualname__rb   re   r>   r>   r>   r?   r_   Ÿ   s   r_   c                      s$   e Zd Zdddœ‡ fdd„Z‡  ZS )ÚMultipleDoctestFailuresz Sequence[doctest.DocTestFailure]r#   )Úfailuresr%   c                   s   t ƒ  ¡  || _d S rB   )Úsuperrb   rl   ©ra   rl   ©Ú	__class__r>   r?   rb   ­   s    
z MultipleDoctestFailures.__init__)rh   ri   rj   rb   Ú__classcell__r>   r>   ro   r?   rk   ¬   s   rk   ztype[doctest.DocTestRunner]c                    s"   dd l ‰ G ‡ fdd„dˆ jƒ} | S )Nr   c                      s`   e Zd ZdZdddddd	d
œ‡ fdd„Zdddd	dœ‡fdd„Zdddd	dœ‡fdd„Z‡  ZS )z/_init_runner_class.<locals>.PytestDoctestRunnerzˆRunner to collect failures.

        Note that the out variable in this case is a list instead of a
        stdout-like object.
        Nr   Túdoctest.OutputChecker | Noneúbool | NoneÚintrT   r#   ©ÚcheckerÚverboseÚoptionflagsÚcontinue_on_failurer%   c                   s   t ƒ j|||d� || _d S )N)rv   rw   rx   )rm   rb   ry   )ra   rv   rw   rx   ry   ro   r>   r?   rb   ¼   s    z8_init_runner_class.<locals>.PytestDoctestRunner.__init__údoctest.DocTestzdoctest.Exampler:   )ÚtestÚexampleÚgotr%   c                   s(   ˆ   |||¡}| jr | |¡ n|‚d S rB   )ÚDocTestFailurery   r4   )ra   Úoutr{   r|   r}   Úfailure©Údoctestr>   r?   Úreport_failureÆ   s    z>_init_runner_class.<locals>.PytestDoctestRunner.report_failurez>tuple[type[BaseException], BaseException, types.TracebackType])r{   r|   Úexc_infor%   c                   sX   t |d tƒr|d ‚t |d tjƒr0t d¡ ˆ  |||¡}| jrP| |¡ n|‚d S )Né   zQuitting debugger)	Ú
isinstancer   ÚbdbZBdbQuitr   ÚexitÚUnexpectedExceptionry   r4   )ra   r   r{   r|   r„   r€   r�   r>   r?   Úreport_unexpected_exceptionÓ   s    
zK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception)NNr   T)rh   ri   rj   Ú__doc__rb   rƒ   rŠ   rq   r>   r�   ro   r?   ÚPytestDoctestRunnerµ   s       û
rŒ   )r‚   ZDebugRunner)rŒ   r>   r�   r?   Ú_init_runner_class²   s    /r�   Trr   rs   rt   údoctest.DocTestRunnerru   c                 C  s   t d u rtƒ a t | |||d�S )N©rv   rw   rx   ry   )rC   r�   r�   r>   r>   r?   Ú_get_runnerç   s    ür�   c                      s¢   e Zd Zddddddœ‡ fdd„Zeddddd	d
œ‡ fdd„ƒZddœdd„Zddœdd„Zddœdd„Zddœdd„Z	dddœ‡ fdd„Z
ddœdd„Z‡  ZS )ÚDoctestItemr:   zDoctestTextfile | DoctestModulerŽ   rz   r#   )rU   rF   ÚrunnerÚdtestr%   c                   sR   t ƒ  ||¡ || _|| _d | _| jj}|j| d d d�}|| _|j	| _
|  ¡  d S )N)ÚnodeÚfuncÚcls)rm   rb   r’   r“   Úobjr\   Ú_fixturemanagerZgetfixtureinfoZ_fixtureinfoZnames_closureZfixturenamesÚ_initrequest)ra   rU   rF   r’   r“   ÚfmZfixtureinforo   r>   r?   rb   ü   s    zDoctestItem.__init__r   )rF   rU   r’   r“   r%   c                  s   t ƒ j||||d�S )zThe public named constructor.)rU   rF   r’   r“   )rm   rP   )r–   rF   rU   r’   r“   ro   r>   r?   rP     s    zDoctestItem.from_parentrA   c                 C  s   i | _ t| dd�| _d S )NT)Z	_ispytest)Zfuncargsr   Ú_request©ra   r>   r>   r?   r™     s    zDoctestItem._initrequestc                 C  sL   | j  ¡  t| j jd�}| j  d¡ ¡ D ]\}}|||< q(| jj |¡ d S )N)Z
getfixtureÚdoctest_namespace)r›   Z_fillfixturesÚdictZgetfixturevalueÚitemsr“   r^   Úupdate)ra   r^   rU   Úvaluer>   r>   r?   Úsetup   s
    

zDoctestItem.setupc                 C  s8   t | jƒ |  ¡  g }| jj| j|d� |r4t|ƒ‚d S )N)r   )Ú_check_all_skippedr“   Ú$_disable_output_capturing_for_darwinr’   Úrunrk   rn   r>   r>   r?   Úruntest'  s    
zDoctestItem.runtestc                 C  sV   t  ¡ dkrdS | jj d¡}|rR|jdd� | ¡ \}}tj 	|¡ tj
 	|¡ dS )zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).ÚDarwinNZcapturemanagerT)Zin_)ÚplatformÚsystemrI   ZpluginmanagerZ	getpluginZsuspend_global_captureZread_global_captureÚsysÚstdoutÚwriteÚstderr)ra   Zcapmanr   Úerrr>   r>   r?   r¤   1  s    z0DoctestItem._disable_output_capturing_for_darwinzExceptionInfo[BaseException]zstr | TerminalRepr)Úexcinfor%   c                   sÚ  dd l }d }t|j|j|jfƒr*|jg}nt|jtƒr>|jj}|d u rRtƒ  |¡S g }|D �]t}|j	}|j
‰ ˆ j}ˆ jd u r‚d }nˆ j|j d }t|ƒj}	t|||	ƒ}
tƒ }t| j d¡ƒ}|d u�r*|j
jd usØJ ‚|j
j d¡}ˆ jd usôJ ‚‡ fdd„t|ƒD ƒ}|t|jd dƒ|jd … }n6dg}d	}|j ¡ D ] }| d
|› d|› �¡ d}�q>t||jƒ�rŠ|| ||j|¡ d¡7 }n8t |j¡}|d|j›�g7 }|dd„ t j!|jŽ D ƒ7 }| |
|f¡ qZt"|ƒS )Nr   r…   r2   Fc                   s*   g | ]"\}}|ˆ j  d  d›d|› �‘qS )r…   Z03dú )Úlineno)rX   ÚiÚx©r{   r>   r?   Ú
<listcomp>c  s   z,DoctestItem.repr_failure.<locals>.<listcomp>é	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z??? r°   z...Ú
zUNEXPECTED EXCEPTION: c                 S  s   g | ]}|  d ¡‘qS )r·   )Ústrip©rX   r³   r>   r>   r?   rµ   w  s   )#r‚   r†   r¡   r~   r‰   rk   rl   rm   Úrepr_failurer|   r{   Úfilenamer±   r)   rh   r   Ú_get_checkerÚ_get_report_choicerI   r]   Ú	docstringÚ
splitlinesÚ	enumerateÚmaxÚsourcer4   Zoutput_differencer}   Úsplitr   Zfrom_exc_infor„   Ú	tracebackÚformat_exceptionr_   )ra   r¯   r‚   rl   r`   r€   r|   r»   r±   Úmessagerf   rv   Zreport_choicerg   Úindentrd   Zinner_excinforo   r´   r?   rº   =  sd    þÿ





ÿ ÿÿþ
ÿzDoctestItem.repr_failurez.tuple[os.PathLike[str] | str, int | None, str]c                 C  s   | j | jjd| j› �fS )Nz
[doctest] )rH   r“   r±   rU   rœ   r>   r>   r?   Ú
reportinfo}  s    zDoctestItem.reportinfo)rh   ri   rj   rb   ÚclassmethodrP   r™   r¢   r¦   r¤   rº   rÈ   rq   r>   r>   ro   r?   r‘   û   s   
@r‘   zdict[str, int]c                  C  s4   dd l } t| j| j| j| j| j| jtƒ t	ƒ t
ƒ d�	S )Nr   )	ÚDONT_ACCEPT_TRUE_FOR_1ÚDONT_ACCEPT_BLANKLINEÚNORMALIZE_WHITESPACEr(   ÚIGNORE_EXCEPTION_DETAILÚCOMPARISON_FLAGSÚALLOW_UNICODEÚALLOW_BYTESÚNUMBER)r‚   rž   rÊ   rË   rÌ   r(   rÍ   rÎ   Ú_get_allow_unicode_flagÚ_get_allow_bytes_flagÚ_get_number_flagr�   r>   r>   r?   Ú_get_flag_lookup�  s    ÷rÕ   )rI   r%   c                 C  s.   |   d¡}tƒ }d}|D ]}||| O }q|S )Nr&   r   )ÚgetinirÕ   )rI   Zoptionflags_strZflag_lookup_tableZflag_accÚflagr>   r>   r?   Úget_optionflags‘  s    
rØ   c                 C  s    |   d¡}|r|   d¡rd}|S )Nr9   ZusepdbF)Úgetvalue)rI   ry   r>   r>   r?   Ú_get_continue_on_failureš  s
    

rÚ   c                   @  s   e Zd ZdZddœdd„ZdS )rR   NúIterable[DoctestItem]rA   c                 c  s–   dd l }| j d¡}| j |¡}t| jƒ}| jj}ddi}t| jƒ}td|t	ƒ t
| jƒd�}| ¡ }	|	 ||||d¡}
|
jr’tj| |
j||
d�V  d S )Nr   r+   rh   Ú__main__F©rw   rx   rv   ry   ©rU   r’   r“   )r‚   rI   rÖ   rH   Ú	read_textr:   rU   rØ   r�   r¼   rÚ   ZDocTestParserZget_doctestÚexamplesr‘   rP   )ra   r‚   ÚencodingÚtextr»   rU   r^   rx   r’   r$   r{   r>   r>   r?   r,   §  s&    

ü
ÿzDoctestTextfile.collect)rh   ri   rj   r—   r,   r>   r>   r>   r?   rR   ¤  s   rR   rz   )r{   r%   c                   s0   ddl ‰ t‡ fdd„| jD ƒƒ}|r,tdƒ dS )zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.r   Nc                 3  s   | ]}|j  ˆ jd ¡V  qdS )FN)ÚoptionsÚgetZSKIPr¹   r�   r>   r?   rZ   È  r[   z%_check_all_skipped.<locals>.<genexpr>z!all tests skipped by +SKIP option)r‚   Úallrà   r   )r{   Zall_skippedr>   r�   r?   r£   Ã  s    r£   Úobject)r—   r%   c                 C  s   t | ddƒduS )zmReturn if an object is possibly a mock object by checking the
    existence of a highly improbable attribute.Z1pytest_mock_example_attribute_that_shouldnt_existNr   ©r—   r>   r>   r?   Ú
_is_mockedÍ  s    
ÿÿrè   zGenerator[None]c                  #  sF   t j‰ ddœddddœ‡ fdd„} | t _zdV  W ˆ t _nˆ t _0 dS )	z€Context manager which replaces ``inspect.unwrap`` with a version
    that's aware of mock objects and doesn't recurse into them.N©ÚstopzCallable[..., Any]zCallable[[Any], Any] | Noner	   )r•   rê   r%   c             
     s€   z:|d u s|t u r ˆˆt d�W S |‰ ˆˆ‡ ‡fdd„d�W S  tyz } z(t d|›dˆ›d�t¡ ‚ W Y d }~n
d }~0 0 d S )Nré   c                   s   t | ƒpˆ ˆƒS rB   )rè   rç   ©Ú_stopr•   r>   r?   Ú<lambda>ã  r[   zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>zGot z when unwrapping z.  This is usually caused by a violation of Python's object protocol; see e.g. https://github.com/pytest-dev/pytest/issues/5080)rè   Ú	ExceptionÚwarningsÚwarnr   )r•   rê   Úe©Zreal_unwraprë   r?   Ú_mock_aware_unwrapÜ  s    üz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap)ÚinspectÚunwrap)ró   r>   rò   r?   Ú_patch_unwrap_mock_awareÖ  s    ÿrö   c                   @  s   e Zd Zddœdd„ZdS )rO   rÛ   rA   c                 c  sÄ   dd l }G dd„ d|jƒ}z
| j}W n4 tjyX   | j d¡rRtd| j›�ƒ n‚ Y n0 | j	j
 | ¡ |ƒ }t| jƒ}td|tƒ t| jƒd�}| ||j¡D ] }|jržtj| |j||d�V  qžd S )	Nr   c                      s�   e Zd Zejdd… Zedk pDedkr2ejjdk pDedkoDejjdk ZerV‡ fdd„Zejd	k rrd
dœ‡ fdd„Z	ejdk rˆ‡ fdd„Z
‡  ZS )z5DoctestModule.collect.<locals>.MockAwareDocTestFinderNé   )é   é   r¶   )rø   é   rø   c                   s8   t |tƒrt|d|ƒ}t|dƒr*t |¡}tƒ  ||¡S )a%  On older Pythons, doctest code does not take into account
                    `@property`. https://github.com/python/cpython/issues/61648

                    Moreover, wrapped Doctests need to be unwrapped so the correct
                    line number is returned. #8796
                    ÚfgetÚ__wrapped__)r†   ÚpropertyÚgetattrÚhasattrrô   rõ   rm   Ú_find_lineno)ra   r—   Úsource_linesro   r>   r?   r     s    


þzBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno)rø   é
   r#   rA   c              
     sN   t |ƒrdS tƒ �( tƒ  |||||||¡ W d  ƒ n1 s@0    Y  dS )zÌOverride _find to work around issue in stdlib.

                    https://github.com/pytest-dev/pytest/issues/3456
                    https://github.com/python/cpython/issues/69718
                    N)rè   rö   rm   Ú_find)ra   Ztestsr—   rU   Úmoduler  r^   Úseenro   r>   r?   r    s    ÿz;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find)rø   é   c                   s    t |tjƒr|j}tƒ  ||¡S )a>  `cached_property` objects are never considered a part
                    of the 'current module'. As such they are skipped by doctest.
                    Here we override `_from_module` to check the underlying
                    function instead. https://github.com/python/cpython/issues/107995
                    )r†   Ú	functoolsÚcached_propertyr•   rm   Ú_from_module)ra   r  ræ   ro   r>   r?   r	  )  s    zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)rh   ri   rj   rª   Úversion_infoZpy_ver_info_minorÚmicroZis_find_lineno_brokenr   r  r	  rq   r>   r>   ro   r?   ÚMockAwareDocTestFinderø  s   ÿý

r  r8   zunable to import module FrÝ   rÞ   )r‚   ZDocTestFinderr—   r   ZCollectErrorrI   rÙ   r   rH   r\   r˜   ZparsefactoriesrØ   r�   r¼   rÚ   Úfindrh   rà   r‘   rP   rU   )ra   r‚   r  r  Úfinderrx   r’   r{   r>   r>   r?   r,   õ  s,    =

ü
ÿzDoctestModule.collectN)rh   ri   rj   r,   r>   r>   r>   r?   rO   ô  s   rO   ztype[doctest.OutputChecker]c                  C  s   dd l } G dd„ d| jƒ}|S )Nr   c                      sd   e Zd Ze dej¡Ze dej¡Ze dej¡Z	dddddœ‡ fdd	„Z
dddd
œdd„Z‡  ZS )z2_init_checker_class.<locals>.LiteralsOutputCheckerz(\W|^)[uU]([rR]?[\'\"])z(\W|^)[bB]([rR]?[\'\"])aÍ  
            (?P<number>
              (?P<mantissa>
                (?P<integer1> [+-]?\d*)\.(?P<fraction>\d+)
                |
                (?P<integer2> [+-]?\d+)\.
              )
              (?:
                [Ee]
                (?P<exponent1> [+-]?\d+)
              )?
              |
              (?P<integer3> [+-]?\d+)
              (?:
                [Ee]
                (?P<exponent2> [+-]?\d+)
              )
            )
            r:   rt   rT   )Úwantr}   rx   r%   c                   s¬   t ƒ  |||¡rdS |tƒ @ }|tƒ @ }|tƒ @ }|sB|sB|sBdS ddddœdd„}|rp|| j|ƒ}|| j|ƒ}|rŒ|| j|ƒ}|| j|ƒ}|rœ|  ||¡}t ƒ  |||¡S )NTFzre.Pattern[str]r:   )ÚregexÚtxtr%   c                 S  s   t  | d|¡S )Nz\1\2)ÚreÚsub)r  r  r>   r>   r?   Úremove_prefixes~  s    zX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes)rm   Úcheck_outputrÒ   rÓ   rÔ   Ú_unicode_literal_reÚ_bytes_literal_reÚ_remove_unwanted_precision)ra   r  r}   rx   Zallow_unicodeZallow_bytesZallow_numberr  ro   r>   r?   r  s  s"    


z?_init_checker_class.<locals>.LiteralsOutputChecker.check_output)r  r}   r%   c                 S  s  t | j |¡ƒ}t | j |¡ƒ}t|ƒt|ƒkr4|S d}t||ƒD ]Ð\}}| d¡}| d¡}	|	d u rp| d¡}	|d u r|dnt|ƒ}
|	d ur˜|
t|	ƒ8 }
t| ¡ ƒtt| ¡ ƒd|
  d�krB|d | 	¡ | … | ¡  || 
¡ | d …  }|| 
¡ | 	¡  | 
¡ | 	¡   7 }qB|S )Nr   ÚfractionZ	exponent1Z	exponent2r  )Úabs)ÚlistÚ
_number_reÚfinditerÚlenÚzipr=   rt   Úfloatr   ÚstartÚend)ra   r  r}   ZwantsÚgotsÚoffsetÚwÚgr  ÚexponentÚ	precisionr>   r>   r?   r  Ž  s$    


&.ÿ&zM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision)rh   ri   rj   r  ÚcompileÚUNICODEr  r  ÚVERBOSEr  r  r  rq   r>   r>   ro   r?   ÚLiteralsOutputCheckerU  s   ìr,  )r‚   ZOutputChecker)r‚   r,  r>   r>   r?   Ú_init_checker_classR  s    Qr-  zdoctest.OutputCheckerc                   C  s   t du rtƒ a t ƒ S )aà  Return a doctest.OutputChecker subclass that supports some
    additional options:

    * ALLOW_UNICODE and ALLOW_BYTES options to ignore u'' and b''
      prefixes (respectively) in string literals. Useful when the same
      doctest should run in Python 2 and Python 3.

    * NUMBER to ignore floating-point differences smaller than the
      precision of the literal number in the doctest.

    An inner class is used to avoid importing "doctest" at the module
    level.
    N)r"   r-  r>   r>   r>   r?   r¼   ©  s    r¼   c                  C  s   ddl } |  d¡S )z+Register and return the ALLOW_UNICODE flag.r   NrÏ   ©r‚   Zregister_optionflagr�   r>   r>   r?   rÒ   ½  s    rÒ   c                  C  s   ddl } |  d¡S )z)Register and return the ALLOW_BYTES flag.r   NrÐ   r.  r�   r>   r>   r?   rÓ   Ä  s    rÓ   c                  C  s   ddl } |  d¡S )z$Register and return the NUMBER flag.r   NrÑ   r.  r�   r>   r>   r?   rÔ   Ë  s    rÔ   r:   )Úkeyr%   c              
   C  s,   ddl }t|jt|jt|jt|jt	di|  S )zÓReturn the actual `doctest` module flag value.

    We want to do it as late as possible to avoid importing `doctest` and all
    its dependencies when parsing options, as it adds overhead and breaks tests.
    r   N)
r‚   ÚDOCTEST_REPORT_CHOICE_UDIFFZREPORT_UDIFFÚDOCTEST_REPORT_CHOICE_CDIFFZREPORT_CDIFFÚDOCTEST_REPORT_CHOICE_NDIFFZREPORT_NDIFFÚ(DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILUREZREPORT_ONLY_FIRST_FAILUREÚDOCTEST_REPORT_CHOICE_NONE)r/  r‚   r>   r>   r?   r½   Ò  s    ûúr½   r\   )Úscopezdict[str, Any]c                   C  s   t ƒ S )a€  Fixture that returns a :py:class:`dict` that will be injected into the
    namespace of doctests.

    Usually this fixture is used in conjunction with another ``autouse`` fixture:

    .. code-block:: python

        @pytest.fixture(autouse=True)
        def add_np(doctest_namespace):
            doctest_namespace["np"] = numpy

    For more details: :ref:`doctest_namespace`.
    )rž   r>   r>   r>   r?   r�   ã  s    r�   )NNr   T)_r‹   Ú
__future__r   r‡   Úcollections.abcr   r   r   r   Ú
contextlibr   r  rô   ÚosÚpathlibr   r¨   r  rª   rÄ   ÚtypesÚtypingr	   r
   rï   Z_pytestr   Z_pytest._code.coder   r   r   Z_pytest._ior   Z_pytest.compatr   Z_pytest.configr   Z_pytest.config.argparsingr   Z_pytest.fixturesr   r   Z_pytest.nodesr   r   Z_pytest.outcomesr   r   Z_pytest.pathlibr   Z_pytest.pythonr   Z_pytest.python_apir   Z_pytest.warning_typesr   r‚   Ztyping_extensionsr   r4  r1  r2  r0  r3  r<   rC   r"   Ú__annotations__r@   rD   rS   rM   rQ   rN   r_   rî   rk   r�   r�   r‘   rÕ   rØ   rÚ   rR   r£   rè   rö   rO   r-  r¼   rÒ   rÓ   rÔ   r½   r�   r>   r>   r>   r?   Ú<module>   s¬   û	26    ü 	

	^W