
    yIfe                        U d 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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l0m1Z1 ddl0m2Z2 dd l3m4Z4 dd!l5m6Z6 dd"l7m8Z8 dd#l9m:Z: er
ddl;Z;dd$lm<Z< d%Z=d&Z>d'Z?d(Z@d)ZAe=e>e?e@eAfZBdaCdaDeed*                  eEd+<   d,e)d-dfd.ZFd_d/ZGd0ed1e.d-eed2                  fd3ZHd4ed-eIfd5ZJd6e'd4ed1e.d-eIfd7ZKd4ed-eIfd8ZL G d9 d:e!          ZM G d; d<eN          ZOd-ed=         fd>ZP	 	 	 	 d`d@ed*         dAeeI         dBeQdCeId-d=f
dDZR G dE dFe/          ZSd-eeTeQf         fdGZUd6e'd-eQfdHZVd6e'd-eIfdIZW G dJ dKe6          ZXdadNZYdOeZd-eIfdPZ[ed-edQ         fdR            Z\ G dS dTe6          Z]d-ed*         fdUZ^dbdVZ_d-eQfdWZ`d-eQfdXZad-eQfdYZbdZeTd-eQfd[Zc e+d\]          d-eeTef         fd^            ZddS )cz4Discover and run doctests in modules and test files.    N)contextmanager)Path)Any)Callable)Dict)	Generator)Iterable)List)Optional)Pattern)Sequence)Tuple)Type)TYPE_CHECKING)Union)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_failuredoctest.OutputCheckerCHECKER_CLASSparserreturnc                    |                      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)r5   collectz--doctest-modules
store_trueFzRun doctests in all .py modulesdoctestmodules)actionr5   helpdestz--doctest-reportr*   z9Choose another output format for diffs on doctest failuredoctestreport)r4   r5   r;   choicesr<   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r:   r5   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_failure)addinigetgroup	addoptionstrlowerDOCTEST_REPORT_CHOICES)r.   groups     C/var/www/piapp/venv/lib/python3.11/site-packages/_pytest/doctest.pypytest_addoptionrM   I   sO   
MM#	     MM=w     OOI&&E	OO.     
OOYH&     
OOA     
OO(/+     
OO'K*          c                  
    d a d S N)RUNNER_CLASS rN   rL   pytest_unconfigurerS   {   s     LLLrN   	file_pathparent)DoctestModuleDoctestTextfilec                 ,   |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optionr9   any_is_setup_py_is_main_pyrV   from_parent_is_doctestrW   )rT   rU   r[   s      rL   pytest_collect_filerc      s     ]F5  =' 	E)$$k)&<&<=1
 1
 	E !,,V),DDD	VY	/	/ C**6	*BBB4rN   rZ   c                 T    | j         dk    rdS |                                 }d|v pd|v S )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rZ   contentss     rL   r_   r_      s8    yJu  HH$@(@@rN   r[   c                     j         dv r|j                                      rdS |                     d          pdg}t	          fd|D                       S )N)z.txtz.rstTrA   z	test*.txtc              3   8   K   | ]}t          |          V  d S rP   r!   ).0globrZ   s     rL   	<genexpr>z_is_doctest.<locals>.<genexpr>   s-      88$z$%%888888rN   )r\   session
isinitpath	getoptionr^   )r[   rZ   rU   globss    `  rL   rb   rb      sh    {&&&6>+D+DT+J+J&t]++<}E8888%888888rN   c                     | j         dk    S )Nz__main__.py)re   rY   s    rL   r`   r`      s    9%%rN   c                   V    e Zd Zdeeeee         f                  ddfdZdeddfdZ	dS )ReprFailDoctestreprlocation_linesr/   Nc                     || _         d S rP   )rt   )selfrt   s     rL   __init__zReprFailDoctest.__init__   s     #5rN   twc                 ~    | j         D ]4\  }}|D ]}|                    |           |                    |           5d S rP   )rt   line
toterminal)rv   rx   reprlocationlinesrz   s        rL   r{   zReprFailDoctest.toterminal   sZ    #'#: 	( 	(L%  ##B''''	( 	(rN   )
__name__
__module____qualname__r   r   r   rH   rw   r   r{   rR   rN   rL   rs   rs      sn        5"*51A8C=1P+Q"R5	5 5 5 5
(^ ( ( ( ( ( ( (rN   rs   c                   4     e Zd Zded         ddf fdZ xZS )MultipleDoctestFailuresfailureszdoctest.DocTestFailurer/   Nc                 V    t                                                       || _        d S rP   )superrw   r   )rv   r   	__class__s     rL   rw   z MultipleDoctestFailures.__init__   s$     rN   )r~   r   r   r   rw   __classcell__r   s   @rL   r   r      sQ        !*B!C ! ! ! ! ! ! ! ! ! ! !rN   r   doctest.DocTestRunnerc                  :    dd l  G fddj                  } | S )Nr   c                        e Zd ZdZ	 	 	 	 dded         dee         ded	ed
df
 fdZddddded
dffdZ	ddddde
ee         eej        f         d
df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checkerr,   verboseoptionflagscontinue_on_failurer/   c                 ^    t                                          |||           || _        d S )N)r   r   r   )r   rw   r   )rv   r   r   r   r   r   s        rL   rw   z8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s2     GGWg;WWW':D$$$rN   testdoctest.DocTestexamplezdoctest.Examplegotc                 h     j         |||          }| j        r|                    |           d S |rP   )DocTestFailurer   r?   )rv   outr   r   r   failuredoctests         rL   report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   sC     -g,T7C@@G' 

7#####rN   exc_infoc                    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?   )rv   r   r   r   r   r   r   s         rL   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#####rN   NNr   T)r~   r   r   __doc__r   boolintrw   rH   r   r   r   BaseExceptiontypesTracebackTyper   r   )r   r   s   @rL   PytestDoctestRunnerr      s5       	 	 :>&* (,	; 	;56	; d^	; 		;
 "&	; 	; 	; 	; 	; 	; 	;	 $	 '		
 	 	 	 	 	 	 		 $	 '		
 D/@SST	 	 	 	 	 	 	 	 	 	 	rN   r   )r   DebugRunner)r   r   s    @rL   _init_runner_classr      sL    NNN- - - - - - -g1 - - -^ rN   Tr   r   r   r   c                 R    t           t                      a t          | |||          S )Nr   r   r   r   )rQ   r   r   s       rL   _get_runnerr      s:     )++ /	   rN   c                        e Zd Zdedddddddd	f
 fd
Zedddeddddddf
 fd            ZddZddZddZ	ddZ
dee         deeef         f fdZdeedef         ee         ef         fdZ xZS )DoctestItemre   rU   z%Union[DoctestTextfile, DoctestModule]runnerr   dtestr   r/   Nc                    t                                          ||           || _        || _        d | _        | j        j        }|                    | d d           }|| _        |j	        | _
        |                                  d S )N)nodefunccls)r   rw   r   r   objrm   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)rv   re   rU   r   r   fmfixtureinfor   s          rL   rw   zDoctestItem.__init__   s     	v&&&
 \)''T$'GG''5rN   r&   c                N    t                                          ||||          S )zThe public named constructor.)re   rU   r   r   )r   ra   )r   rU   re   r   r   r   s        rL   ra   zDoctestItem.from_parent  s'     ww""VFRW"XXXrN   c                 @    i | _         t          | d          | _        d S )NT)	_ispytest)funcargsr   _requestrv   s    rL   r   zDoctestItem._initrequest  s!    +-"44888rN   c                    | j                                          t          | j         j                  }| j                             d                                          D ]
\  }}|||<   | j        j                            |           d S )N)
getfixturedoctest_namespace)r   _fillfixturesdictgetfixturevalueitemsr   rp   update)rv   rp   re   values       rL   setupzDoctestItem.setup#  s    ##%%% =>>>=889LMMSSUU 	  	 KD%E$KK
&&&&&rN   c                     t          | j                   |                                  g }| j                            | j        |           |rt          |          d S )N)r   )_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr   )rv   r   s     rL   runtestzDoctestItem.runtest*  se    4:&&&1133335 	
111 	4)(333	4 	4rN   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systemr[   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)rv   capmanr   errs       rL   r   z0DoctestItem._disable_output_capturing_for_darwin4  s    ?((F*445EFF 	"))d)3331133HCJS!!!JS!!!!!		" 	"rN   excinfoc                    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  }nTt;          j        |j                  }|dtA          |j                  z  gz  }|d tC          j"        |j         D             z  }|                    |
|f           tG          |          S )Nr   r   r=   Fc                 :    g | ]\  }}d |j         z   dz   |fz  S )z%03d %sr   )lineno)rj   ixr   s      rL   
<listcomp>z,DoctestItem.repr_failure.<locals>.<listcomp>f  s?       =CaIT[1!4a 88  rN   	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z???  z...
zUNEXPECTED EXCEPTION: %sc                 8    g | ]}|                     d           S )r   )strip)rj   r   s     rL   r   z,DoctestItem.repr_failure.<locals>.<listcomp>z  s/       &'AGGDMM  rN   )$r   r   r   r   r   r   r   r   repr_failurer   r   filenamer   r4   r~   r   _get_checker_get_report_choicer[   ro   	docstring
splitlines	enumeratemaxsourcer?   output_differencer   splitr   from_exc_infor   repr	tracebackformat_exceptionrs   )rv   r   r   r   rt   r   r   r   r   messager|   r   report_choicer}   indentrz   inner_excinfor   r   s                    @rL   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4tM<O7P7PPQQ  +4+EwGW+X    %%|U&;<<<<1222rN   zos.PathLike[str]c                 :    | j         | j        j        d| j        z  fS )Nz[doctest] %s)rZ   r   r   re   r   s    rL   
reportinfozDoctestItem.reportinfo  s    y$*+^di-GGGrN   r/   N)r~   r   r   rH   rw   classmethodra   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   s   @rL   r   r      s        8 (	
 ! 
     & 
Y7
Y 	
Y
 (
Y !
Y 

Y 
Y 
Y 
Y 
Y [
Y9 9 9 9' ' ' '4 4 4 4	" 	" 	" 	">3}->3 
sL 	!>3 >3 >3 >3 >3 >3@HE%(:C(?"@(3-QT"TU H H H H H H H HrN   r   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_WHITESPACEr3   IGNORE_EXCEPTION_DETAILCOMPARISON_FLAGSALLOW_UNICODEALLOW_BYTESNUMBER)r   r   r  r  r  r3   r  r  _get_allow_unicode_flag_get_allow_bytes_flag_get_number_flagr   s    rL   _get_flag_lookupr    sa    NNN&=%;$9! ' ? 1-//)++!!
 
 
 
rN   c                 p    |                      d          }t                      }d}|D ]}|||         z  }|S )Nr1   r   )getinir  )r[   optionflags_strflag_lookup_tableflag_accflags        rL   get_optionflagsr    sK    mm$9::O(**H , ,%d++OrN   c                 b    |                      d          }|r|                      d          rd}|S )NrD   usepdbF)getvalue)r[   r   s     rL   _get_continue_on_failurer#    s?     &0M N N ( ??8$$ 	("'rN   c                   *    e Zd ZdZdee         fdZdS )rW   Nr/   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   r6   r~   __main__Fr   r   r   r   re   r   r   )r   r[   r  rZ   	read_textrH   re   r  r   r   r#  DocTestParserget_doctestexamplesr   ra   )rv   r   encodingtextr   re   rp   r   r   r.   r   s              rL   r7   zDoctestTextfile.collect  s      ;%%&899y""8,,ty>>y~Z(%dk22# NN 8 E E	
 
 
 '&((!!$tXqAA= 	))49V4 *       	 	rN   )r~   r   r   r   r	   r   r7   rR   rN   rL   rW   rW     s9        
C+.      rN   rW   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)rj   r   r   s     rL   rl   z%_check_all_skipped.<locals>.<genexpr>  s5      PPQaimmGL%88PPPPPPrN   z!all tests skipped by +SKIP option)r   allr,  r    )r   all_skippedr   s     @rL   r   r     sY     NNNPPPP$-PPPPPK 20111112 2rN   r   c                 (    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    rL   
_is_mockedr8    s!     	SMtTT	rN   )NNNc               #     K   t           j        dddt          dt          f         dt          t          t          gt          f                  dt          f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   .r;  r/   c                     	 |	|t           u r  t                     S |   fd          S # t          $ r'}t          j        d|d dt                      d }~ww xY w)Nr:  c                 8    t          |           p
           S rP   )r8  )r   _stopr   s    rL   <lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    joo6Tt rN   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)r8  	Exceptionwarningswarnr%   )r   r;  er>  real_unwraps   `  @rL   _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&)inspectunwrapr   r   r   )rE  rD  s    @rL   _patch_unwrap_mock_awarerH    s       .K MQ  sCx +3HcUCZ4H+I	     " (GN%$$$$$s   &A8 8Bc                   &    e Zd Zdee         fdZdS )rV   r/   c              #   J  K   dd l } G d d|j                  }	 | j        }nH# t          j        $ r6 | j                            d          rt          d| j        z             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                   Z     e Zd ZdZ fdZ	 	 d fdZej        dk     r	 fdZ xZ	S  xZ	S )	5DoctestModule.collect.<locals>.MockAwareDocTestFinderzA hackish doctest finder that overrides stdlib internals to fix a stdlib bug.

            https://github.com/pytest-dev/pytest/issues/3456
            https://bugs.python.org/issue25532
            c                     t          |t                    rt          |d|          }t          |d          rt	          j        |          }t                                          ||          S )a3  Doctest code does not take into account `@property`, this
                is a hackish way to fix it. https://bugs.python.org/issue17446

                Wrapped Doctests will need to be unwrapped so the correct
                line number is returned. This will be reported upstream. #8796
                fget__wrapped__)r   propertygetattrhasattrrF  rG  r   _find_lineno)rv   r   source_linesr   s      rL   rS  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sm     c8,, 4!#vs33C3.. .!.--C ww++   rN   r/   Nc           
          t          |          rd S t                      5  t                                          |||||||           d d d            d S # 1 swxY w Y   d S rP   )r8  rH  r   _find)	rv   testsr   re   modulerT  rp   seenr   s	           rL   rV  z;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s     c?? F-//  GGMMsD&,t                   s   (AAA)      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)rv   rX  objectr   s      rL   r_  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module#  s=     "&)*CDD -!' !77//???rN   r	  )
r~   r   r   r   rS  rV  r   version_infor_  r   r   s   @rL   MockAwareDocTestFinderrL    s             (		 	 	 	 	 	 '))
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ rN   rb  rC   zunable to import module %rFr'  r(  )r   DocTestFinderr   r   CollectErrorr[   r"  r    rZ   rm   r   parsefactoriesr  r   r   r#  findr~   r,  r   ra   re   )rv   r   rb  rX  finderr   r   r   s           rL   r7   zDoctestModule.collect  sv     5	 5	 5	 5	 5	W%: 5	 5	 5	n	XFF% 	 	 	{##$BCC 1DI=>>>> ?>	 	$33D999 ('))%dk22# NN 8 E E	
 
 
 KK88 	 	D} !--tyt .     	 	s   # AA('A(N)r~   r   r   r	   r   r7   rR   rN   rL   rV   rV     s;        T+. T T T T T TrN   rV   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e	de	de
def fdZde	de	de	f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+)
              )
            )
            wantr   r   r/   c                    t                                          |||          rdS |t                      z  }|t                      z  }|t	                      z  }|s|s|sdS dt
          t                   dt          dt          f	fd}|r" || j        |          } || j        |          }|r" || j        |          } || j        |          }|r| 	                    ||          }t                                          |||          S )NTFregextxtr/   c                 2                         | d|          S )Nz\1\2)sub)rm  rn  res     rL   remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes|  s    vveWc222rN   )
r   check_outputr  r  r  r   rH   _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)
rv   rk  r   r   allow_unicodeallow_bytesallow_numberrr  r   rq  s
           rL   rs  z?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputq  sI   ww##D#{;; t'*A*C*CCM%(=(?(??K&)9););;L   \ u3ws| 3# 3# 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;???rN   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	exponent2
   )abs)list
_number_refinditerlenziprK   r   floatr$   startend)rv   rk  r   wantsgotsoffsetwgr{  exponent	precisions              rL   rv  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*+''**=*=*+''+*>*># 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JrN   )r~   r   r   compileUNICODErt  ru  VERBOSEr  rH   r   r   rs  rv  r   )r   rq  s   @rL   LiteralsOutputCheckerrj  S  s        
 !jj)CRZPPJJ'A2:NNZZ& J)
 

.	@S 	@s 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@6	3 	S 	S 	 	 	 	 	 	 	 	rN   r  )r   rq  OutputChecker)r   r  rq  s     @rL   _init_checker_classr  O  s_    NNNIIIO O O O O O O 5 O O Ob ! rN   c                  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  rR   rN   rL   r   r     s     +--??rN   c                  *    ddl }  | j        d          S )z+Register and return the ALLOW_UNICODE flag.r   Nr  r   register_optionflagr  s    rL   r  r    s    NNN&7&777rN   c                  *    ddl }  | j        d          S )z)Register and return the ALLOW_BYTES flag.r   Nr  r  r  s    rL   r  r    s    NNN&7&}555rN   c                  *    ddl }  | j        d          S )z$Register and return the NUMBER flag.r   Nr  r  r  s    rL   r  r    s    NNN&7&x000rN   keyc           
          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     rL   r   r     sH     NNN 	$W%9#W%9#W%90'2S"A 
 rN   rm   )scopec                      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   rR   rN   rL   r   r     s     66MrN   r	  r   )r   r   r/   N)r/   r,   )er   r   
contextlibr   r]  rF  ospathlibr   r   r   r  r   typingr   r   r   r   r	   r
   r   r   r   r   r   r   r   rA  _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  rJ   rQ   r-   __annotations__rM   rS   rc   r   r_   rb   r`   rs   r@  r   r   r   r   r   rH   r  r  r#  rW   r   r`  r8  rH  rV   r  r   r  r  r  r   r   rR   rN   rL   <module>r     sK   : : : 



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



                                                                                                 , , , , , , / / / / / / + + + + + + & & & & & & ' ' ' ' ' ' ! ! ! ! ! ! , , , , , , $ $ $ $ $ $ ' ' ' ' ' ' # # # # # #       - - - - - - ! ! ! ! ! ! & & & & & & ! ! ! ! ! ! % % % % % % / / / / / /  NNN# % % % +? ( ,  9=x456 = = =/V / / / / /d    e678   At A A A A A9 9d 9I 9$ 9 9 9 9&d &t & & & &
( 
( 
( 
( 
(l 
( 
( 
(! ! ! ! !i ! ! !2D!89 2 2 2 2l 26" $	 -.d^  	
    (CH CH CH CH CH$ CH CH CHL$sCx.     F s    V         f   >2 2 2 2F t     %),<"= % % % %:U U U U UF U U UpU!T"9: U! U! U! U!p   (8 8 8 8 86s 6 6 6 61# 1 1 1 1C C    " 	y4S>      rN   