
    jf                    b   U d Z ddlm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	m
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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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l/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 er
ddl7Z7ddl8m9Z9 d Z:d!Z;d"Z<d#Z=d$Z>e:e;e<e=e>fZ?da@daAd%eBd&<   djd+ZCdkd,ZDdld2ZEdmd5ZFdnd8ZGdmd9ZH G d: d;e          ZI G d< d=eJ          ZKdod?ZL	 	 	 	 dpdqdIZM G dJ dKe+          ZNdrdMZOdsdNZPdtdOZQ G dP dQe2          ZRdudTZSdvdWZTedwdY            ZU G dZ d[e2          ZVdxd]ZWdyd_ZXdzd`ZYdzdaZZdzdbZ[d{deZ\ e'dfg          d|di            Z]dS )}z4Discover and run doctests in modules and test files.    )annotationsN)contextmanager)Path)Any)Callable)	Generator)Iterable)Pattern)Sequence)TYPE_CHECKING)outcomes)ExceptionInfo)ReprFileLocation)TerminalRepr)TerminalWritersafe_getattr)Config)Parser)fixture)
TopRequest)	Collector)Item)OutcomeException)skip
fnmatch_ex)Module)approx)PytestWarning)Selfnonecdiffndiffudiffonly_first_failurez"type[doctest.OutputChecker] | NoneCHECKER_CLASSparserr   returnNonec                   |                      ddddg           |                      ddd	           |                     d
          }|                    ddddd           |                    dt          j        ddt
          d           |                    ddg ddd           |                    dddd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)r0   collectz--doctest-modules
store_trueFzRun doctests in all .py modulesdoctestmodules)actionr0   helpdestz--doctest-reportr%   z9Choose another output format for diffs on doctest failuredoctestreport)r/   r0   r6   choicesr7   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r5   r0   metavarr6   r7   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)addinigetgroup	addoptionstrlowerDOCTEST_REPORT_CHOICES)r(   groups     Y/lsinfo/ai/hellotax_ai/base_platform/venv/lib/python3.11/site-packages/_pytest/doctest.pypytest_addoptionrH   F   sO   
MM#	     MM=w     OOI&&E	OO.     
OOYH&     
OOA     
OO(/+     
OO'K*          c                 
    d a d S N)RUNNER_CLASS rI   rG   pytest_unconfigurerN   x   s     LLLrI   	file_pathr   parentr   &DoctestModule | DoctestTextfile | Nonec                ,   |j         }| j        dk    rT|j        j        rGt	          t          |           t          |           f          st                              ||           S n-t          || |          rt                              ||           S d S )Nz.pypath)configsuffixoptionr4   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)rO   rP   rU   s      rG   pytest_collect_filer_   ~   s     ]F5  =' 	E)$$k)&<&<=1
 1
 	E !,,V),DDD	VY	/	/ C**6	*BBB4rI   rT   boolc                T    | j         dk    rdS |                                 }d|v pd|v S )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rT   contentss     rG   rY   rY      s8    yJu  HH$@(@@rI   rU   r   c                    j         dv r|j                                      rdS |                     d          pdg}t	          fd|D                       S )N)z.txtz.rstTr<   z	test*.txtc              3  8   K   | ]}t          |          V  d S rK   r   ).0globrT   s     rG   	<genexpr>z_is_doctest.<locals>.<genexpr>   s-      88$z$%%888888rI   )rV   session
isinitpath	getoptionrX   )rU   rT   rP   globss    `  rG   r]   r]      sh    {&&&6>+D+DT+J+J&t]++<}E8888%888888rI   c                    | j         dk    S )Nz__main__.py)rb   rS   s    rG   rZ   rZ      s    9%%rI   c                      e Zd Zd
dZddZd	S )ReprFailDoctestreprlocation_lines0Sequence[tuple[ReprFileLocation, Sequence[str]]]r)   r*   c                    || _         d S rK   )rq   )selfrq   s     rG   __init__zReprFailDoctest.__init__   s     #5rI   twr   c                ~    | j         D ]4\  }}|D ]}|                    |           |                    |           5d S rK   )rq   line
toterminal)rt   rv   reprlocationlinesrx   s        rG   ry   zReprFailDoctest.toterminal   sZ    #'#: 	( 	(L%  ##B''''	( 	(rI   N)rq   rr   r)   r*   )rv   r   r)   r*   )__name__
__module____qualname__ru   ry   rM   rI   rG   rp   rp      s<        5 5 5 5
( ( ( ( ( (rI   rp   c                        e Zd Zd fdZ xZS )MultipleDoctestFailuresfailures Sequence[doctest.DocTestFailure]r)   r*   c                V    t                                                       || _        d S rK   )superru   r   )rt   r   	__class__s     rG   ru   z MultipleDoctestFailures.__init__   s$     rI   )r   r   r)   r*   )r|   r}   r~   ru   __classcell__r   s   @rG   r   r      s=        ! ! ! ! ! ! ! ! ! !rI   r   type[doctest.DocTestRunner]c                 :    dd l  G fddj                  } | S )Nr   c                  H     e Zd ZdZ	 	 	 	 dd fdZdfdZdfdZ xZS )/_init_runner_class.<locals>.PytestDoctestRunnerzRunner to collect failures.

        Note that the out variable in this case is a list instead of a
        stdout-like object.
        Nr   Tcheckerdoctest.OutputChecker | Noneverbosebool | Noneoptionflagsintcontinue_on_failurer`   r)   r*   c                ^    t                                          |||           || _        d S )N)r   r   r   )r   ru   r   )rt   r   r   r   r   r   s        rG   ru   z8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s2     GGWg;WWW':D$$$rI   testdoctest.DocTestexampledoctest.ExamplegotrC   c                h     j         |||          }| j        r|                    |           d S |rK   )DocTestFailurer   r:   )rt   outr   r   r   failuredoctests         rG   report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   sC     -g,T7C@@G' 

7#####rI   exc_info>tuple[type[BaseException], BaseException, types.TracebackType]c                   t          |d         t                    r|d         t          |d         t          j                  rt	          j        d            j        |||          }| j        r|                    |           d S |)N   zQuitting debugger)	
isinstancer   bdbBdbQuitr   exitUnexpectedExceptionr   r:   )rt   r   r   r   r   r   r   s         rG   report_unexpected_exceptionzK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception   s     (1+'788 "qk!(1+s{33 312221g1$JJG' 

7#####rI   NNr   T)
r   r   r   r   r   r   r   r`   r)   r*   )r   r   r   r   r   rC   r)   r*   )r   r   r   r   r   r   r)   r*   )r|   r}   r~   __doc__ru   r   r   r   )r   r   s   @rG   PytestDoctestRunnerr      s        	 	 59#' (,	; 	; 	; 	; 	; 	; 	;	 	 	 	 	 		 	 	 	 	 	 	 	 	 	rI   r   )r   DebugRunner)r   r   s    @rG   _init_runner_classr      sL    NNN- - - - - - -g1 - - -^ rI   Tr   r   r   r   r   r   r   doctest.DocTestRunnerc                R    t           t                      a t          | |||          S )Nr   r   r   r   )rL   r   r   s       rG   _get_runnerr      s:     )++ /	   rI   c                  p     e Zd Zd fdZed fd            ZddZddZddZddZ	d fdZ
ddZ xZS )DoctestItemrb   rC   rP   DoctestTextfile | DoctestModulerunnerr   dtestr   r)   r*   c                   t                                          ||           || _        || _        d | _        | j        j        }|                    | d d           }|| _        |j	        | _
        |                                  d S )N)nodefunccls)r   ru   r   r   objrj   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)rt   rb   rP   r   r   fmfixtureinfor   s          rG   ru   zDoctestItem.__init__   s     	v&&&
 \)''T$'GG''5rI   r!   c               N    t                                          ||||          S )zThe public named constructor.)rb   rP   r   r   )r   r\   )r   rP   rb   r   r   r   s        rG   r\   zDoctestItem.from_parent  s'     ww""VFRW"XXXrI   c                @    i | _         t          | d          | _        d S )NT)	_ispytest)funcargsr   _requestrt   s    rG   r   zDoctestItem._initrequest  s!    +-"44888rI   c                   | j                                          t          | j         j                  }| j                             d                                          D ]
\  }}|||<   | j        j                            |           d S )N)
getfixturedoctest_namespace)r   _fillfixturesdictgetfixturevalueitemsr   rm   update)rt   rm   rb   values       rG   setupzDoctestItem.setup   s    ##%%% =>>>=889LMMSSUU 	  	 KD%E$KK
&&&&&rI   c                    t          | j                   |                                  g }| j                            | j        |           |rt          |          d S )N)r   )_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr   )rt   r   s     rG   runtestzDoctestItem.runtest'  se    4:&&&1133313 	
111 	4)(333	4 	4rI   c                T   t          j                    dk    rdS | j        j                            d          }|rm|                    d           |                                \  }}t          j        	                    |           t          j
        	                    |           dS dS )zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).DarwinNcapturemanagerT)in_)platformsystemrU   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)rt   capmanr   errs       rG   r   z0DoctestItem._disable_output_capturing_for_darwin1  s    ?((F*445EFF 	"))d)3331133HCJS!!!JS!!!!!		" 	"rI   excinfoExceptionInfo[BaseException]str | TerminalReprc                   dd l }d }t          |j        |j        |j        f          r	|j        g}n&t          |j        t
                    r|j        j        }|!t                                          |          S g }|D ]}|j	        }|j
        j        }j        d }nj        |j        z   dz   }t          |          j        }	t          |||	          }
t!                      }t#          | j                            d                    }|z|j
        j        J |j
        j                            d          }j        J fdt-          |          D             }|t/          |j        dz
  d          |j        dz            }n>dg}d}|j                                        D ]}|                    d	| d
|            d} t          ||j                  r3||                    ||j        |                              d          z  }nGt;          j        |j                  }|d|j        gz  }|d tA          j!        |j         D             z  }|                    |
|f           tE          |          S )Nr   r   r8   Fc                :    g | ]\  }}d |j         z   dz   |fz  S )z%03d %sr   )lineno)rg   ixr   s      rG   
<listcomp>z,DoctestItem.repr_failure.<locals>.<listcomp>c  s?       =CaIT[1!4a 88  rI   	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z???  z...
zUNEXPECTED EXCEPTION: c                8    g | ]}|                     d           S )r   )strip)rg   r   s     rG   r   z,DoctestItem.repr_failure.<locals>.<listcomp>w  s/       &'AGGDMM  rI   )#r   r   r   r   r   r   r   r   repr_failurer   r   filenamer   r/   r|   r   _get_checker_get_report_choicerU   rl   	docstring
splitlines	enumeratemaxsourcer:   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionrp   )rt   r   r   r   rq   r   r   r   r   messagerz   r   report_choicer{   indentrx   inner_excinfor   r   s                    @rG   r   zDoctestItem.repr_failure=  s    	  	 MG2G4OP
 
 	.  HH'>?? 	.}-H77''000 )	= )	=GoG<D}H{"w~597mm,G+HfgFFL"nnG.t{/D/D_/U/UVVM!|-999.99%@@{...   GPQVGWGW   c'.1"4a887>A;MMN V #N5577 # #DLL!7!7!7!7!7888"FF'7#9:: 	22W[- %++ !. ;G<L M MJ=3FJJKK  +4+EwGW+X    %%|U&;<<<<1222rI   .tuple[os.PathLike[str] | str, int | None, str]c                :    | j         | j        j        d| j         fS )Nz
[doctest] )rT   r   r   rb   r   s    rG   
reportinfozDoctestItem.reportinfo}  s!    y$*+-E$)-E-EEErI   )
rb   rC   rP   r   r   r   r   r   r)   r*   )
rP   r   rb   rC   r   r   r   r   r)   r!   r)   r*   )r   r   r)   r   )r)   r	  )r|   r}   r~   ru   classmethodr\   r   r   r   r   r   r  r   r   s   @rG   r   r      s             & 
Y 
Y 
Y 
Y 
Y [
Y9 9 9 9' ' ' '4 4 4 4	" 	" 	" 	">3 >3 >3 >3 >3 >3@F F F F F F F FrI   r   dict[str, int]c                     dd l } t          | j        | j        | j        | j        | j        | j        t                      t                      t                      	  	        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_flagr   s    rG   _get_flag_lookupr    sa    NNN&=%;$9! ' ? 1-//)++!!
 
 
 
rI   c                p    |                      d          }t                      }d}|D ]}|||         z  }|S )Nr,   r   )getinir  )rU   optionflags_strflag_lookup_tableflag_accflags        rG   get_optionflagsr#    sK    mm$9::O(**H , ,%d++OrI   c                b    |                      d          }|r|                      d          rd}|S )Nr?   usepdbF)getvalue)rU   r   s     rG   _get_continue_on_failurer'    s?     &0M N N ( ??8$$ 	("'rI   c                      e Zd ZdZddZdS )r^   Nr)   Iterable[DoctestItem]c              #    K   dd l }| j                            d          }| j                            |          }t          | j                  }| j        j        }ddi}t          | j                  }t          d|t                      t          | j                            } |j                    }	|	                    ||||d          }
|
j        r't                              | |
j        ||
          V  d S d S )Nr   r1   r|   __main__Fr   r   r   r   rb   r   r   )r   rU   r  rT   	read_textrC   rb   r#  r   r   r'  DocTestParserget_doctestexamplesr   r\   )rt   r   encodingtextr   rb   rm   r   r   r(   r   s              rG   r2   zDoctestTextfile.collect  s      ;%%&899y""8,,ty>>y~Z(%dk22# NN 8 E E	
 
 
 '&((!!$tXqAA= 	))49V4 *       	 	rI   r)   r)  )r|   r}   r~   r   r2   rM   rI   rG   r^   r^     s-        
C     rI   r^   r   r   c                v    ddl t          fd| j        D                       }|rt          d           dS dS )zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.r   Nc              3  X   K   | ]$}|j                             j        d           V  %dS )FN)optionsgetSKIP)rg   r   r   s     rG   ri   z%_check_all_skipped.<locals>.<genexpr>  s5      PPQaimmGL%88PPPPPPrI   z!all tests skipped by +SKIP option)r   allr1  r   )r   all_skippedr   s     @rG   r   r     sY     NNNPPPP$-PPPPPK 20111112 2rI   r   objectc                (    t          | dd          duS )zmReturn if an object is possibly a mock object by checking the
    existence of a highly improbable attribute.1pytest_mock_example_attribute_that_shouldnt_existNr   )r   s    rG   
_is_mockedr?    s!     	SMtTT	rI   Generator[None]c               #     K   t           j        ddd
fd	} | t           _        	 dV  t           _        dS # t           _        w xY w)zContext manager which replaces ``inspect.unwrap`` with a version
    that's aware of mock objects and doesn't recurse into them.Nstopr   Callable[..., Any]rC  Callable[[Any], Any] | Noner)   r   c                    	 |	|t           u r  t                     S |   fd          S # t          $ r'}t          j        d|d dt                      d }~ww xY w)NrB  c                8    t          |           p
           S rK   )r?  )r   _stopr   s    rG   <lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    joo6Tt rI   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   rC  erH  real_unwraps   `  @rG   _mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap  s    	|tz11"{4j9999E;t*T*T*T*T*TUUUU 	 	 	MCq C CT C C C 	   	s   5 5 
A&"A!!A&)r   rD  rC  rE  r)   r   )inspectunwrap)rO  rN  s    @rG   _patch_unwrap_mock_awarerR    st       .K JN       " (GN%$$$$$s	   8 Ac                      e Zd ZddZdS )r[   r)   r)  c              #  J  K   dd l } G d d|j                  }	 | j        }nH# t          j        $ r6 | j                            d          rt          d| j                   n Y nw xY w| j	        j
                            |             |            }t          | j                  }t          d|t                      t          | j                            }|                    ||j                  D ].}|j        r%t&                              | |j        ||          V  /d S )	Nr   c                       e Zd Zej        dd         Zedk     p+edk    oej        j        dk     pedk    oej        j        dk     Zer fdZej        dk     rd fdZ	ej        dk     r	 fdZ
 xZS  xZS )5DoctestModule.collect.<locals>.MockAwareDocTestFinderN   )      r   )rX     rX  c                    t          |t                    rt          |d|          }t          |d          rt	          j        |          }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hasattrrP  rQ  r   _find_lineno)rt   r   source_linesr   s      rG   ra  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sm     "#x00 8%c6377sM22 2%nS11 !77//$  rI   )rX  
   r)   r*   c           
         t          |          rdS t                      5  t                                          |||||||           ddd           dS # 1 swxY w Y   dS )zOverride _find to work around issue in stdlib.

                    https://github.com/pytest-dev/pytest/issues/3456
                    https://github.com/python/cpython/issues/69718
                    N)r?  rR  r   _find)	rt   testsr   rb   modulerb  rm   seenr   s	           rG   re  z;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s     "# 133  !3flE4                   s   (AAA)rX     c                    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   r   _from_module)rt   rg  r<  r   s      rG   rm  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)  s=     "&)*CDD -!' !77//???rI   r  )r|   r}   r~   r   version_infopy_ver_info_minormicrois_find_lineno_brokenra  re  rm  r   r   s   @rG   MockAwareDocTestFinderrV    s        # 0! 4!G+ Q%0OS5E5Ka5OQ%0OS5E5Ka5O "
 %     ( '))       '))
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ *)))rI   rr  r>   zunable to import module Fr,  r-  )r   DocTestFinderr   r   CollectErrorrU   r&  r   rT   rj   r   parsefactoriesr#  r   r   r'  findr|   r1  r   r\   rb   )rt   r   rr  rg  finderr   r   r   s           rG   r2   zDoctestModule.collect  s     ;	@ ;	@ ;	@ ;	@ ;	@W%: ;	@ ;	@ ;	@z	XFF% 	 	 	{##$BCC =	==>>>> ?>	 	$33D999 ('))%dk22# NN 8 E E	
 
 
 KK88 	 	D} !--tyt .     	 	s   # AA('A(Nr4  )r|   r}   r~   r2   rM   rI   rG   r[   r[     s.        Z Z Z Z Z ZrI   r[   type[doctest.OutputChecker]c                 B    dd l } dd l G fdd| j                  }|S )Nr   c                       e Zd Z                    dj                  Z                    dj                  Z                    dj                  Zd fdZ	ddZ
 xZS )2_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+)
              )
            )
            wantrC   r   r   r   r)   r`   c                   t                                          |||          rdS |t                      z  }|t                      z  }|t	                      z  }|s|s|sdS d		fd}|r" || j        |          } || j        |          }|r" || j        |          } || j        |          }|r|                     ||          }t                                          |||          S )
NTFregexPattern[str]txtrC   r)   c                2                         | d|          S )Nz\1\2)sub)r~  r  res     rG   remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes  s    vveWc222rI   )r~  r  r  rC   r)   rC   )r   check_outputr  r  r  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)
rt   r|  r   r   allow_unicodeallow_bytesallow_numberr  r   r  s
           rG   r  z?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputt  s0   ww##D#{;; t'*A*C*CCM%(=(?(??K&)9););;L   \ u3 3 3 3 3 3  E&t'?FF%od&>DD C&t'=tDD%od&<cBB A55dC@@77''c;???rI   c                   t          | j                            |                    }t          | j                            |                    }t          |          t          |          k    r|S d}t	          ||          D ]o\  }}|                    d          }|                    d          }	|	|                    d          }	|dnt          |          }
|	|
t          |	          z  }
t          |                                          t          t          |                                          d|
 z            k    r|d |	                                |z            |                                z   ||
                                |z   d          z   }||
                                |	                                z
  |
                                |	                                z
  z
  z  }q|S )Nr   fraction	exponent1	exponent2rc  )abs)list
_number_refinditerlenziprF   r   floatr   startend)rt   r|  r   wantsgotsoffsetwgr  exponent	precisions              rG   r  zM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision  s   11$7788E005566D5zzSYY&&
FE4(( J J1'(wwz':':'(ww{';';# ww{33H!)!1AAs8}}	'X.I##veAGGII.>.>B
N'S'S'SSS
 0aggii&001AGGII=AEEGGfDTDVDV@WW  aeegg		1QUUWWqwwyy5HIIFJrI   )r|  rC   r   rC   r   r   r)   r`   )r|  rC   r   rC   r)   rC   )r|   r}   r~   compileUNICODEr  r  VERBOSEr  r  r  r   )r   r  s   @rG   LiteralsOutputCheckerr{  V  s        
 !jj)CRZPPJJ'A2:NNZZ& J)
 

.	@ 	@ 	@ 	@ 	@ 	@ 	@6	 	 	 	 	 	 	 	rI   r  )r   r  OutputChecker)r   r  r  s     @rG   _init_checker_classr  R  s_    NNNIIIO O O O O O O 5 O O Ob ! rI   doctest.OutputCheckerc                 H    t           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.
    )r'   r  rM   rI   rG   r   r     s     +--??rI   c                 *    ddl }  | j        d          S )z+Register and return the ALLOW_UNICODE flag.r   Nr  r   register_optionflagr  s    rG   r  r    s    NNN&7&777rI   c                 *    ddl }  | j        d          S )z)Register and return the ALLOW_BYTES flag.r   Nr  r  r  s    rG   r  r    s    NNN&7&}555rI   c                 *    ddl }  | j        d          S )z$Register and return the NUMBER flag.r   Nr  r  r  s    rG   r  r    s    NNN&7&x000rI   keyrC   c           
         ddl }t          |j        t          |j        t
          |j        t          |j        t          di|          S )zReturn 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_UDIFFREPORT_UDIFFDOCTEST_REPORT_CHOICE_CDIFFREPORT_CDIFFDOCTEST_REPORT_CHOICE_NDIFFREPORT_NDIFF(DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILUREREPORT_ONLY_FIRST_FAILUREDOCTEST_REPORT_CHOICE_NONE)r  r   s     rG   r   r     sH     NNN 	$W%9#W%9#W%90'2S"A 
 rI   rj   )scopedict[str, Any]c                     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   rM   rI   rG   r   r     s     66MrI   )r(   r   r)   r*   r  )rO   r   rP   r   r)   rQ   )rT   r   r)   r`   )rU   r   rT   r   rP   r   r)   r`   )r)   r   r   )
r   r   r   r   r   r   r   r`   r)   r   )r)   r  )rU   r   r)   r   )rU   r   r)   r`   )r   r   r)   r*   )r   r<  r)   r`   )r)   r@  )r)   rx  )r)   r  )r)   r   )r  rC   r)   r   )r)   r  )^r   
__future__r   r   
contextlibr   rk  rP  ospathlibr   r   r   r  typestypingr   r   r   r	   r
   r   r   rK  _pytestr   _pytest._code.coder   r   r   _pytest._ior   _pytest.compatr   _pytest.configr   _pytest.config.argparsingr   _pytest.fixturesr   r   _pytest.nodesr   r   _pytest.outcomesr   r   _pytest.pathlibr   _pytest.pythonr   _pytest.python_apir   _pytest.warning_typesr    r   typing_extensionsr!   r  r  r  r  r  rE   rL   r'   __annotations__rH   rN   r_   rY   r]   rZ   rp   rJ  r   r   r   r   r  r#  r'  r^   r   r?  rR  r[   r  r   r  r  r  r   r   rM   rI   rG   <module>r     s   : : : " " " " " " 



 % % % % % %      				        



                                                             , , , , , , / / / / / / + + + + + + & & & & & & ' ' ' ' ' ' ! ! ! ! ! ! , , , , , , $ $ $ $ $ $ ' ' ' ' ' ' # # # # # #       - - - - - - ! ! ! ! ! ! & & & & & & ! ! ! ! ! ! % % % % % % / / / / / /  'NNN&&&&&&# % % % +? ( ,  48 8 8 8 8/ / / /d      A A A A9 9 9 9& & & &
( 
( 
( 
( 
(l 
( 
( 
(! ! ! ! !i ! ! !2 2 2 2l -1 $	    (CF CF CF CF CF$ CF CF CFL              f   >2 2 2 2    % % % %:[ [ [ [ [F [ [ [|U! U! U! U!p   (8 8 8 86 6 6 61 1 1 1   " 	y     rI   