+
    yjf                      a  0 t $ R t^ RIHt ^ RIt^ RIHt ^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH t  ^ RI!H"t" ^ RI#H$t$ ^ RI%H&t& ^ RI'H(t( ^ RI'H)t) ^ RI*H+t+ ^ RI*H,t, ^ RI-H.t. ^ RI-H/t/ ^ RI0H1t1 ^ RI2H3t3 ^ RI4H5t5 ^ RI6H7t7 ]'       d   ^ RI8t8^ RIH9t9 Rt:R t;R!t<R"t=R#t>]:];]<]=]>3t?Rs@RsAR$]BR%&   R& R' ltCR( R) ltDR* R+ ltER, R- ltFR. R/ ltGR0 R1 ltH ! R2 R3]4      tI ! R4 R5]J4      tKR6 R7 ltLR\R8 R9 lltM ! R: R;],4      tNR< R= ltOR> R? ltPR@ RA ltQ ! RB RC]34      tRRD RE ltSRF RG ltT]RH RI l4       tU ! RJ RK]34      tVRL RM ltWRN RO ltXRP RQ ltYRR RS ltZRT RU lt[RV RW lt\](! RXRY7      RZ R[ l4       t]R# )]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                    V ^8  d   QhRRRR/# )   parserr   returnNone )formats   "C/var/www/html/2rare/lib/python3.14/site-packages/_pytest/doctest.py__annotate__r/   E   s     / /V / /    c           	        V P                  R RRR.R7       V P                  RRRR7       V P                  R	4      pVP                  R
RRRRR7       VP                  R\        P                  RR\
        RR7       VP                  RR. RRRR7       VP                  RRRRRR7       VP                  RRRRR R7       R!# )"doctest_optionflagszOption flags for doctestsargsELLIPSIS)typedefaultdoctest_encodingzEncoding used for doctest fileszutf-8)r6   collectz--doctest-modules
store_trueFzRun doctests in all .py modulesdoctestmodules)actionr6   helpdestz--doctest-reportr$   z9Choose another output format for diffs on doctest failuredoctestreport)r5   r6   r<   choicesr=   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r;   r6   metavarr<   r=   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_failureN)addinigetgroup	addoptionstrlowerDOCTEST_REPORT_CHOICES)r)   groups   & r.   pytest_addoptionrM   E   s    
MM#	   MM=w   OOI&E	OO.   
OOYYH&   
OOA   
OO(/+   
OO'K*  r0   c                   V ^8  d   QhRR/# r(   r*   r+   r,   )r-   s   "r.   r/   r/   w   s      D r0   c                 
    R s R # N)RUNNER_CLASSr,   r0   r.   pytest_unconfigurerS   w   s	     Lr0   c               $    V ^8  d   QhRRRRRR/# )r(   	file_pathr   parentr   r*   z&DoctestModule | DoctestTextfile | Noner,   )r-   s   "r.   r/   r/   }   s&       ,r0   c                B   VP                   pV P                  R 8X  dZ   VP                  P                  '       d<   \	        \        V 4      \        V 4      34      '       g   \        P                  WR7      # R# \        W V4      '       d   \        P                  WR7      # R# )z.pypathN)configsuffixoptionr:   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)rU   rV   rZ   s   && r.   pytest_collect_filerd   }   s     ]]F5 ==''')$k)&<=1
 1
 !,,V,DD  
V	/	/**6*BBr0   c                    V ^8  d   QhRRRR/# r(   rY   r   r*   boolr,   )r-   s   "r.   r/   r/      s     A At A Ar0   c                l    V P                   R 8w  d   R# V P                  4       pRV9   ;'       g    RV9   # )zsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rY   contentss   & r.   r^   r^      s5    yyJ HH$@@(@@r0   c               (    V ^8  d   QhRRRRRRRR/# )	r(   rZ   r   rY   r   rV   r   r*   rg   r,   )r-   s   "r.   r/   r/      s(     9 9 9d 9I 9$ 9r0   c                  a SP                   R9   d$   VP                  P                  S4      '       d   R# V P                  R4      ;'       g    R.p\        ;QJ d    V3R lV 4       F  '       g   K   R# 	  R# ! V3R lV 4       4      # ).txtTrB   z	test*.txtc              3  <   <"   T F  p\        VS4      x  K  	  R # 5irQ   r   ).0globrY   s   & r.   	<genexpr>_is_doctest.<locals>.<genexpr>   s     8%$z$%%%s   F)rn   z.rst)r[   session
isinitpath	getoptionr]   )rZ   rY   rV   globss   &f& r.   rb   rb      sj    {{&&6>>+D+DT+J+J]+<<}E38%83383838%888r0   c                    V ^8  d   QhRRRR/# rf   r,   )r-   s   "r.   r/   r/      s     & &d &t &r0   c                     V P                   R 8H  # )z__main__.py)ri   rX   s   &r.   r_   r_      s    99%%r0   c                  .    ] tR t^tR R ltR R ltRtR# )ReprFailDoctestc                    V ^8  d   QhRRRR/# )r(   reprlocation_linesz0Sequence[tuple[ReprFileLocation, Sequence[str]]]r*   r+   r,   )r-   s   "r.   r/   ReprFailDoctest.__annotate__   s     5 5"R5	5r0   c                	    Wn         R # rQ   r}   )selfr}   s   &&r.   __init__ReprFailDoctest.__init__   s
     #5r0   c                    V ^8  d   QhRRRR/# )r(   twr   r*   r+   r,   )r-   s   "r.   r/   r~      s     ( (^ ( (r0   c                	    V P                    F0  w  r#V F  pVP                  V4       K  	  VP                  V4       K2  	  R # rQ   )r}   line
toterminal)r   r   reprlocationlinesr   s   &&   r.   r   ReprFailDoctest.toterminal   s8    #'#:#:L ##B' $;r0   r   N)__name__
__module____qualname____firstlineno__r   r   __static_attributes__r,   r0   r.   r{   r{      s    5
( (r0   r{   c                  .   a  ] tR t^tR V 3R lltRtV ;t# )MultipleDoctestFailuresc                    V ^8  d   QhRRRR/# )r(   failuresz Sequence[doctest.DocTestFailure]r*   r+   r,   )r-   s   "r.   r/   $MultipleDoctestFailures.__annotate__   s     ! !!A !d !r0   c                	0   < \         SV `  4        Wn        R # rQ   )superr   r   )r   r   	__class__s   &&r.   r    MultipleDoctestFailures.__init__   s     r0   )r   )r   r   r   r   r   r   __classcell__r   s   @r.   r   r      s    ! !r0   r   c                   V ^8  d   QhRR/# )r(   r*   ztype[doctest.DocTestRunner]r,   )r-   s   "r.   r/   r/      s     2 27 2r0   c                 @   a ^ RI o ! V3R lRSP                  4      p V # )    Nc                  \   <a  ] tR t^tRtR	R V 3R llltR V3R lltR V3R lltRtV ;t	# )
/_init_runner_class.<locals>.PytestDoctestRunnerzpRunner to collect failures.

Note that the out variable in this case is a list instead of a
stdout-like object.
c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r(   checkerdoctest.OutputChecker | Noneverbosebool | Noneoptionflagsintcontinue_on_failurerg   r*   r+   r,   )r-   s   "r.   r/   <_init_runner_class.<locals>.PytestDoctestRunner.__annotate__   s<     	; 	;1	; !	; 		;
 "&	; 	;r0   c                	6   < \         SV `  WVR 7       W@n        R# ))r   r   r   N)r   r   r   )r   r   r   r   r   r   s   &&&&&r.   r   8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s     GW;W':$r0   c               (    V ^8  d   QhRRRRRRRR/# )	r(   testdoctest.DocTestexampledoctest.ExamplegotrI   r*   r+   r,   )r-   s   "r.   r/   r      s4     	 	 "	 %		
 	 	r0   c                	x   < SP                   ! W#V4      pV P                  '       d   VP                  V4       R # VhrQ   )DocTestFailurer   r@   )r   outr   r   r   failuredoctests   &&&&& r.   report_failure>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   s4     ,,TC@G'''

7#r0   c               (    V ^8  d   QhRRRRRRRR/# )	r(   r   r   r   r   exc_infoz>tuple[type[BaseException], BaseException, types.TracebackType]r*   r+   r,   )r-   s   "r.   r/   r      s5     	 	 "	 %		
 U	 	r0   c                	>  < \        V^,          \        4      '       d
   V^,          h\        V^,          \        P                  4      '       d   \        P
                  ! R4       SP                  ! W#V4      pV P                  '       d   VP                  V4       R# Vh)   zQuitting debuggerN)	
isinstancer   bdbBdbQuitr   exitUnexpectedExceptionr   r@   )r   r   r   r   r   r   r   s   &&&&& r.   report_unexpected_exceptionK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception   sr     (1+'788qk!(1+s{{331211$JG'''

7#r0   )r   NNr   T)
r   r   r   r   __doc__r   r   r   r   r   )r   r   s   @r.   PytestDoctestRunnerr      s&    		; 	;	 		 	r0   r   )r   DebugRunner)r   r   s    @r.   _init_runner_classr      s!    -g11 -^ r0   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r(   r   r   r   r   r   r   r   rg   r*   doctest.DocTestRunnerr,   )r-   s   "r.   r/   r/      s:      )  	
 r0   c                D    \         f   \        4       s \        V VVVR7      # )Nr   r   r   r   )rR   r   r   s   &&&&r.   _get_runnerr      s-     )+ /	 r0   c                     a  ] tR t^tR V 3R llt]R V 3R ll4       tR R ltR R ltR	 R
 lt	R R lt
R V 3R lltR R ltRtV ;t# )DoctestItemc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r(   ri   rI   rV   DoctestTextfile | DoctestModulerunnerr   dtestr   r*   r+   r,   )r-   s   "r.   r/   DoctestItem.__annotate__   s<       0 &	
  
r0   c                	   < \         SV `  W4       W0n        W@n        R V n        V P
                  P                  pVP                  V R R R7      pW`n        VP                  V n
        V P                  4        R # )N)nodefunccls)r   r   r   r   objrt   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)r   ri   rV   r   r   fmfixtureinfor   s   &&&&&  r.   r   DoctestItem.__init__   sk     	&
 \\))''T$'G''55r0   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r(   rV   r   ri   rI   r   r   r   r   r*   r    r,   )r-   s   "r.   r/   r     sC     
Y 
Y/
Y 	
Y
 &
Y 
Y 

Yr0   c               &   < \         SV `  W!W4R7      # )zThe public named constructor.)ri   rV   r   r   )r   ra   )r   rV   ri   r   r   r   s   &&$$$r.   ra   DoctestItem.from_parent  s     w"F"XXr0   c                   V ^8  d   QhRR/# rO   r,   )r-   s   "r.   r/   r     s     9 9d 9r0   c                	8    / V n         \        V R R7      V n        R# )T)	_ispytestN)funcargsr   _requestr   s   &r.   r   DoctestItem._initrequest  s    +-"448r0   c                   V ^8  d   QhRR/# rO   r,   )r-   s   "r.   r/   r     s     ' 't 'r0   c                	0   V P                   P                  4        \        V P                   P                  R 7      pV P                   P                  R4      P	                  4        F	  w  r#W1V&   K  	  V P
                  P                  P                  V4       R# ))
getfixturedoctest_namespaceN)r   _fillfixturesdictgetfixturevalueitemsr   rw   update)r   rw   ri   values   &   r.   setupDoctestItem.setup  sk    ##% = =>==889LMSSUKD$K V

&r0   c                   V ^8  d   QhRR/# rO   r,   )r-   s   "r.   r/   r   &  s     4 4 4r0   c                	    \        V P                  4       V P                  4        . pV P                  P	                  V P                  VR 7       V'       d   \        V4      hR# ))r   N)_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr   )r   r   s   & r.   runtestDoctestItem.runtest&  sL    4::&11313 	

1)(33 r0   c                   V ^8  d   QhRR/# rO   r,   )r-   s   "r.   r/   r   0  s     	" 	"d 	"r0   c                `   \         P                  ! 4       R8w  d   R# V P                  P                  P	                  R4      pV'       de   VP                  RR7       VP                  4       w  r#\        P                  P                  V4       \        P                  P                  V4       R# R# )zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).DarwinNcapturemanagerT)in_)platformsystemrZ   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)r   capmanr   errs   &   r.   r   0DoctestItem._disable_output_capturing_for_darwin0  s|    ??(**445EF))d)3113HCJJS!JJS!	 r0   c                    V ^8  d   QhRRRR/# )r(   excinfozExceptionInfo[BaseException]r*   zstr | TerminalReprr,   )r-   s   "r.   r/   r   <  s     >3 >3->3 
>3r0   c                	t  < ^ RI pRp\        VP                  VP                  VP                  34      '       d   VP                  .pM6\        VP                  \
        4      '       d   VP                  P                  pVf   \        SV `!  V4      # . pV EF  pVP                  pVP                  pVP                  pVP                  f   Rp	M$VP                  VP                  ,           ^,           p	\        V4      P                  p
\        WV
4      p\!        4       p\#        V P$                  P'                  R4      4      pV	e   VP                  P(                  f   Q hVP                  P(                  P+                  R4      pVP                  f   Q h\-        V4       UUu. uF(  w  ppRWP                  ,           ^,           V3,          NK*  	  pppV\/        VP                  ^	,
          ^ 4      VP                  ^,            pM?R.pRpVP0                  P+                  4        F  pVP3                  RV RV 24       R	pK  	  \        WRP                  4      '       d3   WP5                  WeP6                  V4      P9                  R
4      ,          pM|\:        P<                  ! VP>                  4      pVRVP                  : 2.,          pT\@        PB                  ! VP>                  !   Uu. uF  pVPE                  R
4      NK  	  up,          pVP3                  W34       EK  	  \G        V4      # u uppi u upi )r   Nr>   Fz%03d %sz?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linenor5   r   r   _get_checker_get_report_choicerZ   rv   	docstring
splitlines	enumeratemaxsourcer@   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionstripr{   )r   r  r   r   r}   r   r   r   r  r  messager   r   report_choicer   ixindentr   inner_excinfor   s   &&                  r.   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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/*L5c                   V ^8  d   QhRR/# )r(   r*   z.tuple[os.PathLike[str] | str, int | None, str]r,   )r-   s   "r.   r/   r   |  s     F FJ Fr0   c                	b    V P                   V P                  P                  R V P                   23# )z
[doctest] )rY   r   r  ri   r   s   &r.   
reportinfoDoctestItem.reportinfo|  s(    yy$**++z$))-EEEr0   )r   r   r   r   r   r   r   )r   r   r   r   r   classmethodra   r   r   r   r   r  r0  r   r   r   s   @r.   r   r      sN     & 
Y 
Y9'4	">3 >3@F Fr0   r   c                   V ^8  d   QhRR/# )r(   r*   zdict[str, int]r,   )r-   s   "r.   r/   r/     s      . r0   c                     ^ RI p \        V P                  V P                  V P                  V P
                  V P                  V P                  \        4       \        4       \        4       R7	      # )r   N)	DONT_ACCEPT_TRUE_FOR_1DONT_ACCEPT_BLANKLINENORMALIZE_WHITESPACEr4   IGNORE_EXCEPTION_DETAILCOMPARISON_FLAGSALLOW_UNICODEALLOW_BYTESNUMBER)r   r   r5  r6  r7  r4   r8  r9  _get_allow_unicode_flag_get_allow_bytes_flag_get_number_flagr   s    r.   _get_flag_lookuprA    sZ    &==%;;$99!! ' ? ? 11-/)+!
 
r0   c                    V ^8  d   QhRRRR/# )r(   rZ   r   r*   r   r,   )r-   s   "r.   r/   r/     s      F s r0   c                p    V P                  R 4      p\        4       p^ pV F  pW2V,          ,          pK  	  V# )r2   )getinirA  )rZ   optionflags_strflag_lookup_tableflag_accflags   &    r.   get_optionflagsrI    s;    mm$9:O(*Hd++  Or0   c                    V ^8  d   QhRRRR/# )r(   rZ   r   r*   rg   r,   )r-   s   "r.   r/   r/     s      V  r0   c                j    V P                  R 4      pV'       d   V P                  R4      '       d   RpV# )rE   usepdbF)getvalue)rZ   r   s   & r.   _get_continue_on_failurerN    s2     &0M N ??8$$"'r0   c                  &    ] tR tRtRtR R ltRtR# )rc   i  Nc                   V ^8  d   QhRR/# r(   r*   zIterable[DoctestItem]r,   )r-   s   "r.   r/   DoctestTextfile.__annotate__  s      . r0   c              #  	  "   ^ RI pV P                  P                  R4      pV P                  P	                  V4      p\        V P                  4      pV P                  P                  pRR/p\        V P                  4      p\        RV\        4       \        V P                  4      R7      pVP                  ! 4       p	V	P                  W6WT^ 4      p
V
P                  '       d&   \        P                  W
P                  WR7      x  R# R# 5i)r   Nr7   r   __main__Fr   r   r   r   ri   r   r   )r   rZ   rD  rY   	read_textrI   ri   rI  r   r  rN  DocTestParserget_doctestexamplesr   ra   )r   r   encodingtextr  ri   rw   r   r   r)   r   s   &          r.   r8   DoctestTextfile.collect  s      ;;%%&89yy""8,tyy>yy~~Z(%dkk2# N 8 E	
 &&(!!$tqA===))99V *   s   DDr,   )r   r   r   r   r   r8   r   r,   r0   r.   rc   rc     s    
C r0   rc   c                    V ^8  d   QhRRRR/# )r(   r   r   r*   r+   r,   )r-   s   "r.   r/   r/     s     2 2_ 2 2r0   c                   a ^ RI o\        ;QJ d)    V3R lV P                   4       F  '       d   K   RM	  RM! V3R lV P                   4       4      pV'       d   \        R4       R# R# )zRRaise pytest.skip() if all examples in the given DocTest have the SKIP
option set.Nc              3  n   <"   T F*  qP                   P                  SP                  R 4      x  K,  	  R# 5i)FN)optionsgetSKIP)rp   r*  r   s   & r.   rr   %_check_all_skipped.<locals>.<genexpr>  s%     P-QiimmGLL%88-s   25FTz!all tests skipped by +SKIP option)r   allrZ  r   )r   all_skippedr   s   & @r.   r   r     sA     #P$--P###P$--PPK01 r0   c                    V ^8  d   QhRRRR/# )r(   r   objectr*   rg   r,   )r-   s   "r.   r/   r/     s      F t r0   c                     \        V RR4      RJ# )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   &r.   
_is_mockedrk    s     	SMtT	r0   c                   V ^8  d   QhRR/# )r(   r*   zGenerator[None, None, None]r,   )r-   s   "r.   r/   r/     s     % %"= %r0   c               #     a"   \         P                  oRR/R V3R lllp V \         n         Rx  S\         n        R#   S\         n        i ; i5i)z|Context manager which replaces ``inspect.unwrap`` with a version
that's aware of mock objects and doesn't recurse into them.stopNc               $    V ^8  d   QhRRRRRR/# )r(   r   zCallable[..., Any]rn  zCallable[[Any], Any] | Noner*   r   r,   )r-   s   "r.   r/   ._patch_unwrap_mock_aware.<locals>.__annotate__  s$       +F	r0   c                  <a a  Ve   V\         J d   S! S \         R7      # VoS! S VV 3R lR7      #   \         d+   p\        P                  ! RT: RS : R2\        4       h R p?ii ; i)N)rn  c                :   < \        V 4      ;'       g	    S! S4      # rQ   )rk  )r   _stopr   s   &r.   <lambda>F_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    jo6T6Tt6Tr0   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)rk  	Exceptionwarningswarnr   )r   rn  ers  real_unwraps   f$ @r.   _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   2 2 2 A'%A""A')inspectunwrap)r{  rz  s    @r.   _patch_unwrap_mock_awarer    sB      ..KIM " (GN%$s   )A> AAAc                  "    ] tR tRtR R ltRtR# )r`   i  c                   V ^8  d   QhRR/# rQ  r,   )r-   s   "r.   r/   DoctestModule.__annotate__  s     Z Z. Zr0   c              #  	  "   ^ RI p ! R RVP                  4      p V P                  pT P                  P                  P                  T 4       T! 4       p\        T P
                  4      p\        RT\        4       \        T P
                  4      R7      pTP!                  XTP"                  4       F:  pTP$                  '       g   K  \&        P)                  YP*                  YgR7      x  K<  	  R#   \        P                   d@    T P
                  P                  R4      '       d   \        RT P                  : 24        ELh i ; i5i)	r   Nc                    a  ] tR tRt]P
                  R,          t]R8  ;'       gU    ]R8H  ;'       d"    ]P
                  P                  ^	8  ;'       g'    ]R	8H  ;'       d    ]P
                  P                  ^8  t]'       d   V 3R lt	]P
                  R
8  d
   R V 3R llt
]P
                  R8  d   V 3R ltRtV ;t# RtV ;t# )5DoctestModule.collect.<locals>.MockAwareDocTestFinderi  :Nr(   Nc                   < \        V\        4      '       d   \        VRV4      p\        VR4      '       d   \        P
                  ! V4      p\        SV `  VV4      # )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hasattrr}  r~  r   _find_lineno)r   r   source_linesr   s   &&&r.   r  BDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno   sU     "#x00%c637sM22%nnS1 !7/$ r0   c                   V ^8  d   QhRR/# rO   r,   )r-   s   "r.   r/   BDoctestModule.collect.<locals>.MockAwareDocTestFinder.__annotate__  s      r0   c                   < \        V4      '       d   R# \        4       ;_uu_ 4        \        SV `  WW4WVV4       RRR4       R#   + '       g   i     R# ; i)zOverride _find to work around issue in stdlib.

https://github.com/pytest-dev/pytest/issues/3456
https://github.com/python/cpython/issues/69718
N)rk  r  r   _find)	r   testsr   ri   moduler  rw   seenr   s	   &&&&&&&&r.   r  ;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s>     "#133!l4 4333s   AA	c                z   < \        V\        P                  4      '       d   VP                  p\        SV `  W4      # )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)r   r  rh  r   s   &&&r.   r  BDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module(  s3     "&)*C*CDD!' !7/??r0   r,   )      )r     )r  
   )r     )r   r   r   r   r  version_infopy_ver_info_minormicrois_find_lineno_brokenr  r  r  r   r   r   s   @r.   MockAwareDocTestFinderr    s     # 0 0 4!G+ Q Q%0OOS5E5E5K5Ka5OQ Q%0OOS5E5E5K5Ka5O "
 %( ')   ')
@ 
@ *r0   r  rD   zunable to import module FrU  rV  )r   DocTestFinderr   r   CollectErrorrZ   rM  r   rY   rt   r   parsefactoriesrI  r   r  rN  findr   rZ  r   ra   ri   )r   r   r  r  finderr   r   r   s   &       r.   r8   DoctestModule.collect  s    ;	@W%:%: ;	@z	XXF 	$$33D9 ()%dkk2# N 8 E	
 KK8D}}}!--yy .   9) %% 	{{##$BCC/		}=>		s4   EC0 BE)E05E&E?EEEr,   N)r   r   r   r   r8   r   r,   r0   r.   r`   r`     s    Z Zr0   r`   c                   V ^8  d   QhRR/# )r(   r*   ztype[doctest.OutputChecker]r,   )r-   s   "r.   r/   r/   Q  s     U! U!8 U!r0   c                 H   a ^ RI p ^ RIo ! V3R lRV P                  4      pV# )r   Nc                     <a  ] tR tRt ZP	                  R ZP
                  4      t ZP	                  R ZP
                  4      t ZP	                  R ZP                  4      t	R V V3R llt
R R ltR	tV ;t# )
2_init_checker_class.<locals>.LiteralsOutputCheckeriU  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               (    V ^8  d   QhRRRRRRRR/# )r(   wantrI   r   r   r   r*   rg   r,   )r-   s   "r.   r/   ?_init_checker_class.<locals>.LiteralsOutputChecker.__annotate__s  s.     	@ 	@S 	@s 	@ 	@ 	@r0   c                	  < \         SV `  WV4      '       d   R # V\        4       ,          pV\        4       ,          pV\	        4       ,          pV'       g   V'       g   V'       g   R# R V	3R llpV'       d'   V! V P
                  V4      pV! V P
                  V4      pV'       d'   V! V P                  V4      pV! V P                  V4      pV'       d   V P                  W4      p\         SV `  WV4      # )TFc               $    V ^8  d   QhRRRRRR/# )r(   regexzPattern[str]txtrI   r*   r,   )r-   s   "r.   r/   U_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.__annotate__~  s!     3 3| 3# 3# 3r0   c                *   < SP                  V R V4      # )z\1\2)sub)r  r  res   &&r.   remove_prefixesX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes~  s    vveWc22r0   )r   check_outputr=  r>  r?  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)
r   r  r   r   allow_unicodeallow_bytesallow_numberr  r   r  s
   &&&&    r.   r  ?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputs  s    w#D{;;'*A*CCM%(=(??K&)9);;L \3 3 &t'?'?F%d&>&>D&t'='=tD%d&<&<cB55d@7';??r0   c               $    V ^8  d   QhRRRRRR/# )r(   r  rI   r   r*   r,   )r-   s   "r.   r/   r    s!     	 	3 	S 	S 	r0   c                	   \        V P                  P                  V4      4      p\        V P                  P                  V4      4      p\        V4      \        V4      8w  d   V# ^ p\	        W44       EFP  w  rgVP                  R4      pVP                  R4      p	V	f   VP                  R4      p	Vf   ^ M
\        V4      p
V	e   V
\        V	4      ,          p
\        VP                  4       4      \        \        VP                  4       4      ^
V
) ,          R7      8X  g   K  VRVP                  4       V,            VP                  4       ,           W'P                  4       V,           R ,           pWVP                  4       VP                  4       ,
          VP                  4       VP                  4       ,
          ,
          ,          pEKS  	  V# )r   fraction	exponent1N	exponent2)abs)list
_number_refinditerlenziprL   r   floatr   startend)r   r  r   wantsgotsoffsetwgr  exponent	precisions   &&&        r.   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 )  Jr0   r,   )r   r   r   r   compileUNICODEr  r  VERBOSEr  r  r  r   r   )r   r  s   @r.   LiteralsOutputCheckerr  U  sc    
 !jj)CRZZPJJ'A2::NZZ& JJ)

.	@ 	@6	 	r0   r  )r   r  OutputChecker)r   r  r  s     @r.   _init_checker_classr  Q  s&    O 5 5 Ob ! r0   c                   V ^8  d   QhRR/# )r(   r*   zdoctest.OutputCheckerr,   )r-   s   "r.   r/   r/     s      + r0   c                 :    \         f   \        4       s \        4       # )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  r,   r0   r.   r  r    s     +-?r0   c                   V ^8  d   QhRR/# r(   r*   r   r,   )r-   s   "r.   r/   r/     s     8 8 8r0   c                 .    ^ RI p V P                  ! R4      # )z+Register and return the ALLOW_UNICODE flag.Nr:  r   register_optionflagr@  s    r.   r=  r=    s    &&77r0   c                   V ^8  d   QhRR/# r  r,   )r-   s   "r.   r/   r/     s     6 6s 6r0   c                 .    ^ RI p V P                  ! R4      # )z)Register and return the ALLOW_BYTES flag.Nr;  r  r@  s    r.   r>  r>    s    &&}55r0   c                   V ^8  d   QhRR/# r  r,   )r-   s   "r.   r/   r/     s     1 1# 1r0   c                 .    ^ RI p V P                  ! R4      # )z$Register and return the NUMBER flag.Nr<  r  r@  s    r.   r?  r?    s    &&x00r0   c                    V ^8  d   QhRRRR/# )r(   keyrI   r*   r   r,   )r-   s   "r.   r/   r/     s      C C r0   c           
         ^ RI p\        VP                  \        VP                  \
        VP                  \        VP                  \        ^ /V ,          # )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.
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   & r.   r  r    sN      	$W%9%9#W%9%9#W%9%90'2S2S"A 
 r0   rt   )scopec                   V ^8  d   QhRR/# )r(   r*   zdict[str, Any]r,   )r-   s   "r.   r/   r/     s      > r0   c                     \        4       # )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,   r0   r.   r   r     s     6Mr0   r   )^__conditional_annotations__r   
__future__r   r   
contextlibr   r  r}  ospathlibr   r  r  r$  typestypingr   r   r   r   r	   r
   r   rw  _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   r    r  r  r  r  r  rK   rR   r&   __annotations__rM   rS   rd   r^   rb   r_   r{   rv  r   r   r   r   rA  rI  rN  rc   r   rk  r  r`   r  r  r=  r>  r?  r  r   )r  s   @r.   <module>r     s   : " 
 %   	   
             , / + & ' ! , $ ' #  - ! & ! % / # % % % +? ( ,  481 8/dA9&
(l 
(!i !2j(CF$ CFL f >2 % %:[F [|U!p(861" 	y r0   