
    ?gf                    ~   % S r SSKJr  SSKrSSKJr  SSKrSSKrSSKrSSK	J
r
  SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK J!r!  SSK"J#r#  SSK$J%r%  SSK&J'r'  SSK&J(r(  SSK)J*r*  SSK)J+r+  SSK,J-r-  SSK,J.r.  SSK/J0r0  SSK1J2r2  SSK3J4r4  SSK5J6r6  \(       a
  SSK7r7SSK8J9r9  S r:S!r;S"r<S#r=S$r>\:\;\<\=\>4r?Sq@SqAS%\BS&'   SHS' jrCSIS( jrD      SJS) jrESKS* jrFSLS+ jrGSKS, jrH " S- S.\5      rI " S/ S0\J5      rKSMS1 jrL    SN         SOS2 jjrM " S3 S4\+5      rNSPS5 jrOSQS6 jrPSRS7 jrQ " S8 S9\25      rRSSS: jrSSTS; jrT\SUS< j5       rU " S= S>\25      rVSVS? jrWSWS@ jrXSXSA jrYSXSB jrZSXSC jr[SYSD jr\\'" SESF9SZSG j5       r]g)[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_CLASSc           	     T   U R                  SSSS/S9  U R                  SSSS	9  U R                  S
5      nUR                  SSSSSS9  UR                  S[        R                  SS[
        SS9  UR                  SS/ SSSS9  UR                  SSSSSS9  UR                  SSSS S!S9  g )"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-   r3   choicesr4   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r2   r-   metavarr3   r4   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)parsergroups     1/usr/lib/python3/dist-packages/_pytest/doctest.pypytest_addoptionrF   F   s    
MM#	   MM=w   OOI&E	OO.   
OOYYH&   
OOA   
OO(/+   
OO'K*      c                     S q g N)RUNNER_CLASS rG   rE   pytest_unconfigurerL   x   s	     LrG   c                *   UR                   nU R                  S:X  aS  UR                  R                  (       a7  [	        [        U 5      [        U 5      45      (       d  [        R                  XS9$ g [        X U5      (       a  [        R                  XS9$ g )Nz.pypath)configsuffixoptionr1   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)	file_pathparentrP   s      rE   pytest_collect_filer\   ~   s     ]]F5 =='')$k)&<=1
 1
 !,,V,DD  
V	/	/**6*BBrG   c                f    U R                   S:w  a  gU R                  5       nSU;   =(       d    SU;   $ )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rO   contentss     rE   rT   rT      s2    yyJ HH$@(@@rG   c                   ^ TR                   S;   a!  UR                  R                  T5      (       a  gU R                  S5      =(       d    S/n[	        U4S jU 5       5      $ )N)z.txtz.rstTr9   z	test*.txtc              3  <   >#    U  H  n[        UT5      v   M     g 7frI   r   ).0globrO   s     rE   	<genexpr>_is_doctest.<locals>.<genexpr>   s     8%$z$%%%s   )rQ   session
isinitpath	getoptionrS   )rP   rO   r[   globss    `  rE   rX   rX      sO    {{&&6>>+D+DT+J+J]+<}E8%888rG   c                     U R                   S:H  $ )Nz__main__.py)r^   rN   s    rE   rU   rU      s    99%%rG   c                  0    \ rS rSr    SS jrSS jrSrg)ReprFailDoctest   c                    Xl         g rI   reprlocation_lines)selfrq   s     rE   __init__ReprFailDoctest.__init__   s
     #5rG   c                    U R                    H0  u  p#U H  nUR                  U5        M     UR                  U5        M2     g rI   )rq   line
toterminal)rr   twreprlocationlinesrv   s        rE   rw   ReprFailDoctest.toterminal   s8    #'#:#:L ##B' $;rG   rp   N)rq   z0Sequence[tuple[ReprFileLocation, Sequence[str]]]returnNone)rx   r   r|   r}   )__name__
__module____qualname____firstlineno__rs   rw   __static_attributes__rK   rG   rE   rm   rm      s    5"R5	5
(rG   rm   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )MultipleDoctestFailures   c                .   > [         TU ]  5         Xl        g rI   )superrs   failures)rr   r   	__class__s     rE   rs    MultipleDoctestFailures.__init__   s     rG   )r   )r   z Sequence[doctest.DocTestFailure]r|   r}   )r~   r   r   r   rs   r   __classcell__r   s   @rE   r   r      s    ! !rG   r   c                 @   ^ SS K m " U4S jSTR                  5      n U $ )Nr   c                     >^  \ rS rSrSr    S         SU 4S jjjr        S	U4S jjr        S
U4S jjrSrU =r	$ )/_init_runner_class.<locals>.PytestDoctestRunner   zpRunner to collect failures.

Note that the out variable in this case is a list instead of a
stdout-like object.
c                .   > [         TU ]  XUS9  X@l        g )N)checkerverboseoptionflags)r   rs   continue_on_failure)rr   r   r   r   r   r   s        rE   rs   8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s     GW;W':$rG   c                t   > TR                   " X#U5      nU R                  (       a  UR                  U5        g UerI   )DocTestFailurer   r7   )rr   outtestexamplegotfailuredoctests         rE   report_failure>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   s1     ,,TC@G''

7#rG   c                  > [        US   [        5      (       a  US   e[        US   [        R                  5      (       a  [        R
                  " S5        TR                  " X#U5      nU R                  (       a  UR                  U5        g Ue)N   zQuitting debugger)	
isinstancer   bdbBdbQuitr   exitUnexpectedExceptionr   r7   )rr   r   r   r   exc_infor   r   s         rE   report_unexpected_exceptionK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception   so     (1+'788qk!(1+s{{331211$JG''

7#rG   )r   NNr   T)
r   doctest.OutputChecker | Noner   bool | Noner   intr   boolr|   r}   )r   doctest.DocTestr   doctest.Exampler   r@   r|   r}   )r   r   r   r   r   z>tuple[type[BaseException], BaseException, types.TracebackType]r|   r}   )
r~   r   r   r   __doc__rs   r   r   r   r   )r   r   s   @rE   PytestDoctestRunnerr      s    	 59#' (,	;1	; !	; 		;
 "&	; 	; 	;	 "	 %		
 	 		 "	 %		
 U	 	 	rG   r   )r   DebugRunner)r   r   s    @rE   _init_runner_classr      s!    -g11 -^ rG   c                <    [         c
  [        5       q [        U UUUS9$ )Nr   r   r   r   )rJ   r   r   s       rE   _get_runnerr      s-     )+ /	 rG   c                     ^  \ rS rSr          SU 4S jjr\          SU 4S jj5       rSS jrSS jrSS jr	SS jr
    SU 4S jjrSS	 jrS
rU =r$ )DoctestItem   c                   > [         TU ]  X5        X0l        X@l        S U l        U R
                  R                  nUR                  U S S S9nX`l        UR                  U l
        U R                  5         g )N)nodefunccls)r   rs   runnerdtestobjrg   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)rr   r^   r[   r   r   fmfixtureinfor   s          rE   rs   DoctestItem.__init__   sk     	&
 \\))''T$'G''55rG   c                   > [         TU ]  X!X4S9$ )zThe public named constructor.)r^   r[   r   r   )r   rW   )r   r[   r^   r   r   r   s        rE   rW   DoctestItem.from_parent  s     w"F"XXrG   c                0    0 U l         [        U SS9U l        g )NT)	_ispytest)funcargsr   _requestrr   s    rE   r   DoctestItem._initrequest  s    +-"448rG   c                (   U R                   R                  5         [        U R                   R                  S9nU R                   R                  S5      R	                  5        H	  u  p#X1U'   M     U R
                  R                  R                  U5        g )N)
getfixturedoctest_namespace)r   _fillfixturesdictgetfixturevalueitemsr   rj   update)rr   rj   r^   values       rE   setupDoctestItem.setup   sk    ##% = =>==889LMSSUKD$K V

&rG   c                    [        U R                  5        U R                  5         / nU R                  R	                  U R                  US9  U(       a  [        U5      eg )N)r   )_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr   )rr   r   s     rE   runtestDoctestItem.runtest'  sL    4::&11313 	

1)(33 rG   c                P   [         R                  " 5       S:w  a  gU R                  R                  R	                  S5      nU(       a`  UR                  SS9  UR                  5       u  p#[        R                  R                  U5        [        R                  R                  U5        gg)zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).DarwinNcapturemanagerT)in_)platformsystemrP   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)rr   capmanr   errs       rE   r   0DoctestItem._disable_output_capturing_for_darwin1  s|    ??(**445EF))d)3113HCJJS!JJS!	 rG   c                  > SS K nS n[        UR                  UR                  UR                  45      (       a  UR                  /nO5[        UR                  [
        5      (       a  UR                  R                  nUc  [        TU ]!  U5      $ / nU GH^  nUR                  nUR                  nUR                  nUR                  c  S n	OUR                  UR                  -   S-   n	[        U5      R                  n
[        XU
5      n[!        5       n[#        U R$                  R'                  S5      5      nU	b  UR                  R(                  c   eUR                  R(                  R+                  S5      nUR                  c   e[-        U5       VVs/ s H  u  nnSXR                  -   S-   U4-  PM     nnnU[/        UR                  S-
  S5      UR                  S-    nO?S/nSnUR0                  R+                  5        H  nUR3                  S	U S
U 35        SnM     [        XRR                  5      (       a.  XR5                  XeR6                  U5      R9                  S5      -  nOt[:        R<                  " UR>                  5      nUSUR                  < 3/-  nU[@        RB                  " UR>                  6  Vs/ s H  nURE                  S5      PM     sn-  nUR3                  X45        GMa     [G        U5      $ s  snnf s  snf )Nr   r   r5   Fz%03d %s	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z???  z...
zUNEXPECTED EXCEPTION: )$r   r   r   r   r   r   r   r   repr_failurer   r   filenamelinenor,   r~   r   _get_checker_get_report_choicerP   ri   	docstring
splitlines	enumeratemaxsourcer7   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionstriprm   )rr   excinfor   r   rq   r   r   r   r   r   messagery   r   report_choicerz   ixindentrv   inner_excinfor   s                       rE   r   DoctestItem.repr_failure=  s    	  	 MMG22G4O4OP
 
  H'>??}}--H7'00GooG<<D}}H{{"w~~597m,,G+HgFL"nG.t{{/D/D_/UVM!||--999..99%@{{...GPQVGWGWVaI[[1!4a 88GW   c'..1"4a87>>A;MN V #NN557DLL4xq!78"F 8 '#9#9::22[[-%+ !. ; ;G<L<L M2=3F3F2IJKK+4+E+EwGWGW+X+XaAGGDM+X  %%|&;<S  T 1221(s   #L >Lc                b    U R                   U R                  R                  SU R                   34$ )Nz
[doctest] )rO   r   r   r^   r   s    rE   
reportinfoDoctestItem.reportinfo}  s(    yy$**++z$))-EEErG   )r   r   r   r   r   r   r   )
r^   r@   r[   DoctestTextfile | DoctestModuler   doctest.DocTestRunnerr   r   r|   r}   )
r[   r  r^   r@   r   r  r   r   r|   r!   r|   r}   )r
  zExceptionInfo[BaseException]r|   zstr | TerminalRepr)r|   z.tuple[os.PathLike[str] | str, int | None, str])r~   r   r   r   rs   classmethodrW   r   r   r   r   r   r  r   r   r   s   @rE   r   r      s     0 &	
  
& 
Y/
Y 	
Y
 &
Y 
Y 

Y 
Y9'4	">3->3 
>3@F FrG   r   c                     SS K n [        U R                  U R                  U R                  U R
                  U R                  U R                  [        5       [        5       [        5       S9	$ )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    rE   _get_flag_lookupr&    sZ    &==%;;$99!! ' ? ? 11-/)+!
 
rG   c                `    U R                  S5      n[        5       nSnU H
  nX2U   -  nM     U$ )Nr)   r   )getinir&  )rP   optionflags_strflag_lookup_tableflag_accflags        rE   get_optionflagsr-    s;    mm$9:O(*Hd++  OrG   c                f    U R                  S5      nU(       a  U R                  S5      (       a  SnU$ )Nr<   usepdbF)getvalue)rP   r   s     rE   _get_continue_on_failurer1    s2     &0M N ??8$$"'rG   c                  "    \ rS rSrSrSS jrSrg)rY   i  Nc              #    #    SS K nU R                  R                  S5      nU R                  R	                  U5      n[        U R                  5      nU R                  R                  nSS0n[        U R                  5      n[        SU[        5       [        U R                  5      S9nUR                  " 5       n	U	R                  X6XTS5      n
U
R                  (       a!  [        R                  X
R                  XS9v   g g 7f)Nr   r.   r~   __main__Fr   r   r   r   r^   r   r   )r   rP   r(  rO   	read_textr@   r^   r-  r   r   r1  DocTestParserget_doctestexamplesr   rW   )rr   r   encodingtextr   r^   rj   r   r   rC   r   s              rE   r/   DoctestTextfile.collect  s      ;;%%&89yy""8,tyy>yy~~Z(%dkk2# N 8 E	
 &&(!!$tqA==))99V *   s   C=C?rK   r|   zIterable[DoctestItem])r~   r   r   r   r   r/   r   rK   rG   rE   rY   rY     s    
CrG   rY   c                r   ^ SSK m[        U4S jU R                   5       5      nU(       a  [        S5        gg)zRRaise pytest.skip() if all examples in the given DocTest have the SKIP
option set.r   Nc              3  n   >#    U  H*  oR                   R                  TR                  S 5      v   M,     g7f)FN)optionsgetSKIP)rc   r  r   s     rE   re   %_check_all_skipped.<locals>.<genexpr>  s%     P-QiimmGLL%88-s   25z!all tests skipped by +SKIP option)r   allr:  r   )r   all_skippedr   s     @rE   r   r     s-     P$--PPK01 rG   c                     [        U SS5      SL$ )ziReturn 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    rE   
_is_mockedrI    s     	SMtT	rG   c               #     ^#    [         R                  mSS.     SU4S jjjn U [         l         Sv   T[         l        g! T[         l        f = f7f)z|Context manager which replaces ``inspect.unwrap`` with a version
that's aware of mock objects and doesn't recurse into them.Nstopc                  >^ ^  Ub	  U[         L a  T" T [         S9$ UmT" T UU 4S jS9$ ! [         a*  n[        R                  " SU< ST < S3[        5        e S nAff = f)NrK  c                8   > [        U 5      =(       d    T" T5      $ rI   )rI  )r   _stopr   s    rE   <lambda>F_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    jo6Tt6TrG   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)rI  	Exceptionwarningswarnr    )r   rL  erO  real_unwraps   `  @rE   _mock_aware_unwrap4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap  st    	|tz1"4j99Et*TUU 	MMqe,TH 5C C 	 	s   * * 
A%AA)r   zCallable[..., Any]rL  zCallable[[Any], Any] | Noner|   r   )inspectunwrap)rW  rV  s    @rE   _patch_unwrap_mock_awarer[    sY      ..K JN +F	 " (GN%$s   -AA AAAc                      \ rS rSrSS jrSrg)rV   i  c              #  ~  #    SS K n " S SUR                  5      n U R                  nU R                  R                  R                  U 5        U" 5       n[        U R
                  5      n[        SU[        5       [        U R
                  5      S9nUR!                  WUR"                  5       H6  nUR$                  (       d  M  [&        R)                  XR*                  XgS9v   M8     g ! [        R                   a>    U R
                  R                  S5      (       a  [        SU R                  < 35         GNe f = f7f)	Nr   c                  z  ^  \ rS rSr\R
                  SS r\S:  =(       dQ    \S:H  =(       a    \R
                  R                  S:  =(       d%    \S:H  =(       a    \R
                  R                  S:  r\(       a  U 4S jr	\R
                  S	:  a
    SU 4S
 jjr
\R
                  S:  a  U 4S jrSrU =r$ SrU =r$ )5DoctestModule.collect.<locals>.MockAwareDocTestFinderi  N   )      r   )ra     ra  c                   > [        U[        5      (       a  [        USU5      n[        US5      (       a  [        R
                  " U5      n[        TU ]  UU5      $ )zOn 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hasattrrY  rZ  r   _find_lineno)rr   r   source_linesr   s      rE   rj  BDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sU     "#x00%c637sM22%nnS1 !7/$ rG   )ra  
   c           
        > [        U5      (       a  g[        5          [        TU ]  XX4XVU5        SSS5        g! , (       d  f       g= f)zOverride _find to work around issue in stdlib.

https://github.com/pytest-dev/pytest/issues/3456
https://github.com/python/cpython/issues/69718
N)rI  r[  r   _find)	rr   testsr   r^   modulerk  rj   seenr   s	           rE   ro  ;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s8     "#13!l4 433s	   9
A)ra     c                x   > [        U[        R                  5      (       a  UR                  n[        TU ]  X5      $ )z`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)rr   rq  objectr   s      rE   rx  BDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)  s3     "&)*C*CDD!' !7/??rG   rK   r  )r~   r   r   r   r   version_infopy_ver_info_minormicrois_find_lineno_brokenrj  ro  rx  r   r   r   s   @rE   MockAwareDocTestFinderr_    s     # 0 0! 4!G+ Q%0OS5E5E5K5Ka5OQ%0OS5E5E5K5Ka5O "
 %( ')  ')
@ 
@ *rG   r  r;   zunable to import module Fr5  r6  )r   DocTestFinderr   r   CollectErrorrP   r0  r   rO   rg   r   parsefactoriesr-  r   r   r1  findr~   r:  r   rW   r^   )rr   r   r  rq  finderr   r   r   s           rE   r/   DoctestModule.collect  s    ;	@W%:%: ;	@z	XXF 	$$33D9 ()%dkk2# N 8 E	
 KK8D}}}!--yy .   9) %% 	{{##$BCC/		}=>		s/   D=C( BD=%D=(AD:5D=8D::D=rK   Nr>  )r~   r   r   r   r/   r   rK   rG   rE   rV   rV     s    ZrG   rV   c                 H   ^ SS K n SS Km " U4S jSU R                  5      nU$ )Nr   c                     >^  \ rS rSr YR	                  S YR
                  5      r YR	                  S YR
                  5      r YR	                  S YR                  5      r	SU U4S jjr
S	S jrSrU =r$ )
2_init_checker_class.<locals>.LiteralsOutputCheckeriV  z(\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+)
              )
            )
            c                  > [         TU ]  XU5      (       a  gU[        5       -  nU[        5       -  nU[	        5       -  nU(       d  U(       d  U(       d  gSU	4S jjnU(       a&  U" U R
                  U5      nU" U R
                  U5      nU(       a&  U" U R                  U5      nU" U R                  U5      nU(       a  U R                  X5      n[         TU ]  XU5      $ )NTFc                *   > TR                  U SU5      $ )Nz\1\2)sub)regextxtres     rE   remove_prefixesX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes  s    vveWc22rG   )r  zPattern[str]r  r@   r|   r@   )r   check_outputr"  r#  r$  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)
rr   wantr   r   allow_unicodeallow_bytesallow_numberr  r   r  s
           rE   r  ?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputt  s    w#D{;;'*A*CCM%(=(??K&)9);;L \3 &t'?'?F%d&>&>D&t'='=tD%d&<&<cB55d@7';??rG   c                0   [        U R                  R                  U5      5      n[        U R                  R                  U5      5      n[        U5      [        U5      :w  a  U$ Sn[	        X45       GH!  u  pgUR                  S5      nUR                  S5      n	U	c  UR                  S5      n	Uc  SO
[        U5      n
U	b  U
[        U	5      -  n
[        UR                  5       5      [        [        UR                  5       5      SU
* -  S9:X  d  M  US UR                  5       U-    UR                  5       -   X'R                  5       U-   S  -   nXVR                  5       UR                  5       -
  UR                  5       UR                  5       -
  -
  -  nGM$     U$ )Nr   fraction	exponent1	exponent2rm  )abs)list
_number_refinditerlenziprD   r   floatr   startend)rr   r  r   wantsgotsoffsetwgr  exponent	precisions              rE   r  M_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision  sT   11$78E0056D5zSY&
FE('(wwz':'(ww{';# ww{3H!)!1As8}	'X.I#veAGGI.>B
N'SS
 0aggi&01AGGI=EEGfDTDV@WW  eeg	1QUUWqwwy5HIIF )  JrG   rK   )r  r@   r   r@   r   r   r|   r   )r  r@   r   r@   r|   r@   )r~   r   r   r   compileUNICODEr  r  VERBOSEr  r  r  r   r   )r   r  s   @rE   LiteralsOutputCheckerr  V  sc    
 !jj)CRZZPJJ'A2::NZZ& JJ)

.	@ 	@6	 	rG   r  )r   r  OutputChecker)r   r  r  s     @rE   _init_checker_classr  R  s&    O 5 5 Ob ! rG   c                 8    [         c
  [        5       q [        5       $ )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  rK   rG   rE   r   r     s     +-?rG   c                 .    SSK n U R                  " S5      $ )z+Register and return the ALLOW_UNICODE flag.r   Nr  r   register_optionflagr%  s    rE   r"  r"    s    &&77rG   c                 .    SSK n U R                  " S5      $ )z)Register and return the ALLOW_BYTES flag.r   Nr   r  r%  s    rE   r#  r#    s    &&}55rG   c                 .    SSK n U R                  " S5      $ )z$Register and return the NUMBER flag.r   Nr!  r  r%  s    rE   r$  r$    s    &&x00rG   c           
         SSK n[        UR                  [        UR                  [
        UR                  [        UR                  [        S0U    $ )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)keyr   s     rE   r   r     sN      	$W%9%9#W%9%9#W%9%90'2S2S"A 
 rG   rg   )scopec                     [        5       $ )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   rK   rG   rE   r   r     s     6MrG   )rC   r   r|   r}   r  )rZ   r   r[   r   r|   z&DoctestModule | DoctestTextfile | None)rO   r   r|   r   )rP   r   rO   r   r[   r   r|   r   )r|   ztype[doctest.DocTestRunner]r   )
r   r   r   r   r   r   r   r   r|   r  )r|   zdict[str, int])rP   r   r|   r   )rP   r   r|   r   )r   r   r|   r}   )r   ry  r|   r   )r|   zGenerator[None])r|   ztype[doctest.OutputChecker])r|   zdoctest.OutputChecker)r|   r   )r  r@   r|   r   )r|   zdict[str, Any])^r   
__future__r   r   
contextlibr   rv  rY  ospathlibr   r   r   r  typestypingr   r   r   r	   r
   r   r   rS  _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  rB   rJ   r'   __annotations__rF   rL   r\   rT   rX   rU   rm   rR  r   r   r   r   r&  r-  r1  rY   r   rI  r[  rV   r  r   r"  r#  r$  r   r   rK   rG   rE   <module>r     s   : " 
 %   	   
             , / + & ' ! , $ ' #  - ! & ! % / &# % % % +? ( ,  481 8/d ,A9&
(l 
(!i !2l -1 $	)  	
 (CF$ CFL f >2 % %:[F [|U!p(861" 	y rG   