
    F-Phf                    ^   U d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlZddlZddlZdd	lmZ ddlZddlZddlZddlZddlZdd
lmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl'm)Z) ddl*m+Z+ ddl*m,Z, ddl-m.Z. ddl-m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 er
ddl8Z8ddl9m:Z: dZ;d Z<d!Z=d"Z>d#Z?e;e<e=e>e?fZ@daAdaBd$eCd%<   did*ZDdjd+ZEdkd1ZFdld4ZGdmd7ZHdld8ZI G d9 d:e          ZJ G d; d<eK          ZLdnd>ZM	 	 	 	 dodpdHZN G dI dJe,          ZOdqdLZPdrdMZQdsdNZR G dO dPe3          ZSdtdSZTdudVZUe
dvdX            ZV G dY dZe3          ZWdwd\ZXdxd^ZYdyd_ZZdyd`Z[dydaZ\dzddZ] e(def          d{dh            Z^dS )|z4Discover and run doctests in modules and test files.    )annotationsN)Callable)	Generator)Iterable)Sequence)contextmanager)Path)Any)TYPE_CHECKING)outcomes)ExceptionInfo)ReprFileLocation)TerminalRepr)TerminalWritersafe_getattr)Config)Parser)fixture)
TopRequest)	Collector)Item)OutcomeException)skip
fnmatch_ex)Module)approx)PytestWarning)Selfnonecdiffndiffudiffonly_first_failurez"type[doctest.OutputChecker] | NoneCHECKER_CLASSparserr   returnNonec                   |                      ddddg           |                      ddd	           |                     d
          }|                    ddddd           |                    dt          j        ddt
          d           |                    ddg ddd           |                    ddddd           |                    dddd d!           d S )"Ndoctest_optionflagszOption flags for doctestsargsELLIPSIS)typedefaultdoctest_encodingzEncoding used for doctest fileszutf-8)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/   r5   choicesr6   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r4   r/   metavarr5   r6   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     O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/_pytest/doctest.pypytest_addoptionrG   F   sO   
MM#	     MM=w     OOI&&E	OO.     
OOYH&     
OOA     
OO(/+     
OO'K*          c                 
    d a d S N)RUNNER_CLASS rH   rF   pytest_unconfigurerM   x   s     LLLrH   	file_pathr	   parentr   &DoctestModule | DoctestTextfile | Nonec                ,   |j         }| j        dk    rT|j        j        rGt	          t          |           t          |           f          st                              ||           S n-t          || |          rt                              ||           S d S )Nz.pypath)configsuffixoptionr3   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)rN   rO   rT   s      rF   pytest_collect_filer^   ~   s     ]F5  =' 	E)$$k)&<&<=1
 1
 	E !,,V),DDD	VY	/	/ C**6	*BBB4rH   rS   boolc                T    | j         dk    rdS |                                 }d|v pd|v S )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rS   contentss     rF   rX   rX      s8    yJu  HH$@(@@rH   rT   r   c                    j         dv r|j                                      rdS |                     d          pdg}t	          fd|D                       S )N)z.txtz.rstTr;   z	test*.txtc              3  8   K   | ]}t          |          V  d S rJ   r   ).0globrS   s     rF   	<genexpr>z_is_doctest.<locals>.<genexpr>   s-      88$z$%%888888rH   )rU   session
isinitpath	getoptionrW   )rT   rS   rO   globss    `  rF   r\   r\      sh    {&&&6>+D+DT+J+J&t]++<}E8888%888888rH   c                    | j         dk    S )Nz__main__.py)ra   rR   s    rF   rY   rY      s    9%%rH   c                      e Zd Zd
dZddZd	S )ReprFailDoctestreprlocation_lines0Sequence[tuple[ReprFileLocation, Sequence[str]]]r(   r)   c                    || _         d S rJ   )rp   )selfrp   s     rF   __init__zReprFailDoctest.__init__   s     #5rH   twr   c                ~    | j         D ]4\  }}|D ]}|                    |           |                    |           5d S rJ   )rp   line
toterminal)rs   ru   reprlocationlinesrw   s        rF   rx   zReprFailDoctest.toterminal   sZ    #'#: 	( 	(L%  ##B''''	( 	(rH   N)rp   rq   r(   r)   )ru   r   r(   r)   )__name__
__module____qualname__rt   rx   rL   rH   rF   ro   ro      s<        5 5 5 5
( ( ( ( ( (rH   ro   c                        e Zd Zd fdZ xZS )MultipleDoctestFailuresfailures Sequence[doctest.DocTestFailure]r(   r)   c                V    t                                                       || _        d S rJ   )superrt   r   )rs   r   	__class__s     rF   rt   z MultipleDoctestFailures.__init__   s$     rH   )r   r   r(   r)   )r{   r|   r}   rt   __classcell__r   s   @rF   r   r      s=        ! ! ! ! ! ! ! ! ! !rH   r   type[doctest.DocTestRunner]c                 :    dd l  G fddj                  } | S )Nr   c                  H     e Zd ZdZ	 	 	 	 dd fdZdfdZdfdZ xZS )/_init_runner_class.<locals>.PytestDoctestRunnerzRunner to collect failures.

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

7#####rH   exc_info>tuple[type[BaseException], BaseException, types.TracebackType]c                   t          |d         t                    r|d         t          |d         t          j                  rt	          j        d            j        |||          }| j        r|                    |           d S |)N   zQuitting debugger)	
isinstancer   bdbBdbQuitr   exitUnexpectedExceptionr   r9   )rs   r   r   r   r   r   r   s         rF   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#####rH   NNr   T)
r   r   r   r   r   r   r   r_   r(   r)   )r   r   r   r   r   rB   r(   r)   )r   r   r   r   r   r   r(   r)   )r{   r|   r}   __doc__rt   r   r   r   )r   r   s   @rF   PytestDoctestRunnerr      s        	 	 59#' (,	; 	; 	; 	; 	; 	; 	;	 	 	 	 	 		 	 	 	 	 	 	 	 	 	rH   r   )r   DebugRunner)r   r   s    @rF   _init_runner_classr      sL    NNN- - - - - - -g1 - - -^ rH   Tr   r   r   r   r   r   r   doctest.DocTestRunnerc                R    t           t                      a t          | |||          S )Nr   r   r   r   )rK   r   r   s       rF   _get_runnerr      s:     )++ /	   rH   c                  p     e Zd Zd fdZed fd            ZddZddZddZddZ	d fdZ
ddZ xZS )DoctestItemra   rB   rO   DoctestTextfile | DoctestModulerunnerr   dtestr   r(   r)   c                   t                                          ||           || _        || _        d | _        | j        j        }|                    | d d           }|| _        |j	        | _
        |                                  d S )N)nodefunccls)r   rt   r   r   objri   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)rs   ra   rO   r   r   fmfixtureinfor   s          rF   rt   zDoctestItem.__init__   s     	v&&&
 \)''T$'GG''5rH   r    c               N    t                                          ||||          S )zThe public named constructor.)ra   rO   r   r   )r   r[   )r   rO   ra   r   r   r   s        rF   r[   zDoctestItem.from_parent  s'     ww""VFRW"XXXrH   c                @    i | _         t          | d          | _        d S )NT)	_ispytest)funcargsr   _requestrs   s    rF   r   zDoctestItem._initrequest  s!    +-"44888rH   c                   | j                                          t          | j         j                  }| j                             d                                          D ]
\  }}|||<   | j        j                            |           d S )N)
getfixturedoctest_namespace)r   _fillfixturesdictgetfixturevalueitemsr   rl   update)rs   rl   ra   values       rF   setupzDoctestItem.setup   s    ##%%% =>>>=889LMMSSUU 	  	 KD%E$KK
&&&&&rH   c                    t          | j                   |                                  g }| j                            | j        |           |rt          |          d S )N)r   )_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr   )rs   r   s     rF   runtestzDoctestItem.runtest'  se    4:&&&1133313 	
111 	4)(333	4 	4rH   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systemrT   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)rs   capmanr   errs       rF   r   z0DoctestItem._disable_output_capturing_for_darwin1  s    ?((F*445EFF 	"))d)3331133HCJS!!!JS!!!!!		" 	"rH   excinfoExceptionInfo[BaseException]str | TerminalReprc                   dd l }d }t          |j        |j        |j        f          r	|j        g}n&t          |j        t
                    r|j        j        }|!t                                          |          S g }|D ]}|j	        }|j
        j        }j        d }nj        |j        z   dz   }t          |          j        }	t          |||	          }
t!                      }t#          | j                            d                    }|z|j
        j        J |j
        j                            d          }j        J fdt-          |          D             }|t/          |j        dz
  d          |j        dz            }n>dg}d}|j                                        D ]}|                    d	| d
|            d} t          ||j                  r3||                    ||j        |                              d          z  }nGt;          j        |j                  }|d|j        gz  }|d tA          j!        |j         D             z  }|                    |
|f           tE          |          S )Nr   r   r7   Fc                <    g | ]\  }}|j         z   d z   dd| S )r   03d )lineno)rf   ixr   s      rF   
<listcomp>z,DoctestItem.repr_failure.<locals>.<listcomp>c  sF       9?!Qq4;*44444  rH   	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z??? r   z...
zUNEXPECTED EXCEPTION: c                8    g | ]}|                     d           S )r   )strip)rf   r   s     rF   r   z,DoctestItem.repr_failure.<locals>.<listcomp>w  s/       &'AGGDMM  rH   )#r   r   r   r   r   r   r   r   repr_failurer   r   filenamer   r.   r{   r   _get_checker_get_report_choicerT   rk   	docstring
splitlines	enumeratemaxsourcer9   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionro   )rs   r   r   r   rp   r   r   r   r   messagery   r   report_choicerz   indentrw   inner_excinfor   r   s                    @rF   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%@@{...   CLUCSCS   c'.1"4a887>A;MMN V #N5577 # #DLL!7!7!7!7!7888"FF'7#9:: 	22W[- %++ !. ;G<L M MJ=3FJJKK  +4+EwGW+X    %%|U&;<<<<1222rH   .tuple[os.PathLike[str] | str, int | None, str]c                :    | j         | j        j        d| j         fS )Nz
[doctest] )rS   r   r   ra   r   s    rF   
reportinfozDoctestItem.reportinfo}  s!    y$*+-E$)-E-EEErH   )
ra   rB   rO   r   r   r   r   r   r(   r)   )
rO   r   ra   rB   r   r   r   r   r(   r    r(   r)   )r   r   r(   r   )r(   r	  )r{   r|   r}   rt   classmethodr[   r   r   r   r   r   r  r   r   s   @rF   r   r      s             & 
Y 
Y 
Y 
Y 
Y [
Y9 9 9 9' ' ' '4 4 4 4	" 	" 	" 	">3 >3 >3 >3 >3 >3@F F F F F F F FrH   r   dict[str, int]c                     dd l } t          | j        | j        | j        | j        | j        | j        t                      t                      t                      	  	        S )Nr   )	DONT_ACCEPT_TRUE_FOR_1DONT_ACCEPT_BLANKLINENORMALIZE_WHITESPACEr-   IGNORE_EXCEPTION_DETAILCOMPARISON_FLAGSALLOW_UNICODEALLOW_BYTESNUMBER)r   r   r  r  r  r-   r  r  _get_allow_unicode_flag_get_allow_bytes_flag_get_number_flagr   s    rF   _get_flag_lookupr    sa    NNN&=%;$9! ' ? 1-//)++!!
 
 
 
rH   c                p    |                      d          }t                      }d}|D ]}|||         z  }|S )Nr+   r   )getinir  )rT   optionflags_strflag_lookup_tableflag_accflags        rF   get_optionflagsr#    sK    mm$9::O(**H , ,%d++OrH   c                b    |                      d          }|r|                      d          rd}|S )Nr>   usepdbF)getvalue)rT   r   s     rF   _get_continue_on_failurer'    s?     &0M N N ( ??8$$ 	("'rH   c                      e Zd ZdZddZdS )r]   Nr(   Iterable[DoctestItem]c              #    K   dd l }| j                            d          }| j                            |          }t          | j                  }| j        j        }ddi}t          | j                  }t          d|t                      t          | j                            } |j                    }	|	                    ||||d          }
|
j        r't                              | |
j        ||
          V  d S d S )Nr   r0   r{   __main__Fr   r   r   r   ra   r   r   )r   rT   r  rS   	read_textrB   ra   r#  r   r   r'  DocTestParserget_doctestexamplesr   r[   )rs   r   encodingtextr   ra   rl   r   r   r'   r   s              rF   r1   zDoctestTextfile.collect  s      ;%%&899y""8,,ty>>y~Z(%dk22# NN 8 E E	
 
 
 '&((!!$tXqAA= 	))49V4 *       	 	rH   r(   r)  )r{   r|   r}   r   r1   rL   rH   rF   r]   r]     s-        
C     rH   r]   r   r   c                v    ddl t          fd| j        D                       }|rt          d           dS dS )zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.r   Nc              3  X   K   | ]$}|j                             j        d           V  %dS )FN)optionsgetSKIP)rf   r   r   s     rF   rh   z%_check_all_skipped.<locals>.<genexpr>  s5      PPQaimmGL%88PPPPPPrH   z!all tests skipped by +SKIP option)r   allr1  r   )r   all_skippedr   s     @rF   r   r     sY     NNNPPPP$-PPPPPK 20111112 2rH   r   objectc                (    t          | dd          duS )zmReturn if an object is possibly a mock object by checking the
    existence of a highly improbable attribute.1pytest_mock_example_attribute_that_shouldnt_existNr   )r   s    rF   
_is_mockedr?    s!     	SMtTT	rH   Generator[None]c               #     K   t           j        ddd
fd	} | t           _        	 dV  t           _        dS # t           _        w xY w)zContext manager which replaces ``inspect.unwrap`` with a version
    that's aware of mock objects and doesn't recurse into them.Nstopr   Callable[..., Any]rC  Callable[[Any], Any] | Noner(   r
   c                    	 |	|t           u r  t                     S |   fd          S # t          $ r'}t          j        d|d dt                      d }~ww xY w)NrB  c                8    t          |           p
           S rJ   )r?  )r   _stopr   s    rF   <lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    joo6Tt rH   zGot z when unwrapping z.  This is usually caused by a violation of Python's object protocol; see e.g. https://github.com/pytest-dev/pytest/issues/5080)r?  	Exceptionwarningswarnr   )r   rC  erH  real_unwraps   `  @rF   _mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap  s    	|tz11"{4j9999E;t*T*T*T*T*TUUUU 	 	 	MCq C CT C C C 	   	s   5 5 
A&"A!!A&)r   rD  rC  rE  r(   r
   )inspectunwrap)rO  rN  s    @rF   _patch_unwrap_mock_awarerR    st       .K JN       " (GN%$$$$$s	   8 Ac                      e Zd ZddZdS )rZ   r(   r)  c              #  J  K   dd l } G d d|j                  }	 | j        }nH# t          j        $ r6 | j                            d          rt          d| j                   n Y nw xY w| j	        j
                            |             |            }t          | j                  }t          d|t                      t          | j                            }|                    ||j                  D ].}|j        r%t&                              | |j        ||          V  /d S )	Nr   c                       e Zd Zej        dd         Zedk     p+edk    oej        j        dk     pedk    oej        j        dk     Zer fdZej        dk     rd fdZ	ej        dk     r	 fdZ
 xZS  xZS )5DoctestModule.collect.<locals>.MockAwareDocTestFinderN   )      r   )rX     rX  c                    t          |t                    rt          |d|          }t          |d          rt	          j        |          }t                                          ||          S )a%  On older Pythons, doctest code does not take into account
                    `@property`. https://github.com/python/cpython/issues/61648

                    Moreover, wrapped Doctests need to be unwrapped so the correct
                    line number is returned. #8796
                    fget__wrapped__)r   propertygetattrhasattrrP  rQ  r   _find_lineno)rs   r   source_linesr   s      rF   ra  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sm     "#x00 8%c6377sM22 2%nS11 !77//$  rH   )rX  
   r(   r)   c           
         t          |          rdS t                      5  t                                          |||||||           ddd           dS # 1 swxY w Y   dS )zOverride _find to work around issue in stdlib.

                    https://github.com/pytest-dev/pytest/issues/3456
                    https://github.com/python/cpython/issues/69718
                    N)r?  rR  r   _find)	rs   testsr   ra   modulerb  rl   seenr   s	           rF   re  z;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s     "# 133  !3flE4                   s   (AAA)rX     c                    t          |t          j                  r|j        }t	                                          ||          S )a>  `cached_property` objects are never considered a part
                    of the 'current module'. As such they are skipped by doctest.
                    Here we override `_from_module` to check the underlying
                    function instead. https://github.com/python/cpython/issues/107995
                    )r   	functoolscached_propertyr   r   _from_module)rs   rg  r<  r   s      rF   rm  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)  s=     "&)*CDD -!' !77//???rH   r  )r{   r|   r}   r   version_infopy_ver_info_minormicrois_find_lineno_brokenra  re  rm  r   r   s   @rF   MockAwareDocTestFinderrV    s        # 0! 4!G+ Q%0OS5E5Ka5OQ%0OS5E5Ka5O "
 %     ( '))       '))
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ 
@ *)))rH   rr  r=   zunable to import module Fr,  r-  )r   DocTestFinderr   r   CollectErrorrT   r&  r   rS   ri   r   parsefactoriesr#  r   r   r'  findr{   r1  r   r[   ra   )rs   r   rr  rg  finderr   r   r   s           rF   r1   zDoctestModule.collect  s     ;	@ ;	@ ;	@ ;	@ ;	@W%: ;	@ ;	@ ;	@z	XFF% 	 	 	{##$BCC =	==>>>> ?>	 	$33D999 ('))%dk22# NN 8 E E	
 
 
 KK88 	 	D} !--tyt .     	 	s   # AA('A(Nr4  )r{   r|   r}   r1   rL   rH   rF   rZ   rZ     s.        Z Z Z Z Z ZrH   rZ   type[doctest.OutputChecker]c                 4    dd l }  G d d| j                  }|S )Nr   c                       e Zd Z ej        dej                  Z ej        dej                  Z ej        dej                  Z	d fdZ
ddZ xZS )2_init_checker_class.<locals>.LiteralsOutputCheckerz(\W|^)[uU]([rR]?[\'\"])z(\W|^)[bB]([rR]?[\'\"])a  
            (?P<number>
              (?P<mantissa>
                (?P<integer1> [+-]?\d*)\.(?P<fraction>\d+)
                |
                (?P<integer2> [+-]?\d+)\.
              )
              (?:
                [Ee]
                (?P<exponent1> [+-]?\d+)
              )?
              |
              (?P<integer3> [+-]?\d+)
              (?:
                [Ee]
                (?P<exponent2> [+-]?\d+)
              )
            )
            wantrB   r   r   r   r(   r_   c                   t                                          |||          rdS |t                      z  }|t                      z  }|t	                      z  }|s|s|sdS d	d}|r" || j        |          } || j        |          }|r" || j        |          } || j        |          }|r|                     ||          }t                                          |||          S )
NTFregexre.Pattern[str]txtrB   r(   c                .    t          j        | d|          S )Nz\1\2)resub)r~  r  s     rF   remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes~  s    veWc222rH   )r~  r  r  rB   r(   rB   )r   check_outputr  r  r  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)	rs   r|  r   r   allow_unicodeallow_bytesallow_numberr  r   s	           rF   r  z?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputs  s&   ww##D#{;; t'*A*C*CCM%(=(?(??K&)9););;L   \ u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;???rH   c                   t          | j                            |                    }t          | j                            |                    }t          |          t          |          k    r|S d}t	          ||          D ]o\  }}|                    d          }|                    d          }	|	|                    d          }	|dnt          |          }
|	|
t          |	          z  }
t          |                                          t          t          |                                          d|
 z            k    r|d |	                                |z            |                                z   ||
                                |z   d          z   }||
                                |	                                z
  |
                                |	                                z
  z
  z  }q|S )Nr   fraction	exponent1	exponent2rc  )abs)list
_number_refinditerlenziprE   r   floatr   startend)rs   r|  r   wantsgotsoffsetwgr  exponent	precisions              rF   r  zM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision  s   11$7788E005566D5zzSYY&&
FE4(( J J1'(wwz':':'(ww{';';# ww{33H!)!1AAs8}}	'X.I##veAGGII.>.>B
N'S'S'SSS
 0aggii&001AGGII=AEEGGfDTDVDV@WW  aeegg		1QUUWWqwwyy5HIIFJrH   )r|  rB   r   rB   r   r   r(   r_   )r|  rB   r   rB   r(   rB   )r{   r|   r}   r  compileUNICODEr  r  VERBOSEr  r  r  r   r   s   @rF   LiteralsOutputCheckerr{  U  s        
 )bj)CRZPP&BJ'A2:NNRZ& J)
 

.	@ 	@ 	@ 	@ 	@ 	@6	 	 	 	 	 	 	 	rH   r  )r   OutputChecker)r   r  s     rF   _init_checker_classr  R  sI    NNNO O O O O 5 O O Ob ! rH   doctest.OutputCheckerc                 H    t           t                      a t                      S )a  Return a doctest.OutputChecker subclass that supports some
    additional options:

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

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

    An inner class is used to avoid importing "doctest" at the module
    level.
    )r&   r  rL   rH   rF   r   r     s     +--??rH   c                 *    ddl }  | j        d          S )z+Register and return the ALLOW_UNICODE flag.r   Nr  r   register_optionflagr  s    rF   r  r    s    NNN&7&777rH   c                 *    ddl }  | j        d          S )z)Register and return the ALLOW_BYTES flag.r   Nr  r  r  s    rF   r  r    s    NNN&7&}555rH   c                 *    ddl }  | j        d          S )z$Register and return the NUMBER flag.r   Nr  r  r  s    rF   r  r    s    NNN&7&x000rH   keyrB   c           
         ddl }t          |j        t          |j        t
          |j        t          |j        t          di|          S )zReturn the actual `doctest` module flag value.

    We want to do it as late as possible to avoid importing `doctest` and all
    its dependencies when parsing options, as it adds overhead and breaks tests.
    r   N)
r   DOCTEST_REPORT_CHOICE_UDIFFREPORT_UDIFFDOCTEST_REPORT_CHOICE_CDIFFREPORT_CDIFFDOCTEST_REPORT_CHOICE_NDIFFREPORT_NDIFF(DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILUREREPORT_ONLY_FIRST_FAILUREDOCTEST_REPORT_CHOICE_NONE)r  r   s     rF   r   r     sH     NNN 	$W%9#W%9#W%90'2S"A 
 rH   ri   )scopedict[str, Any]c                     t                      S )a  Fixture that returns a :py:class:`dict` that will be injected into the
    namespace of doctests.

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

    .. code-block:: python

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

    For more details: :ref:`doctest_namespace`.
    )r   rL   rH   rF   r   r     s     66MrH   )r'   r   r(   r)   r  )rN   r	   rO   r   r(   rP   )rS   r	   r(   r_   )rT   r   rS   r	   rO   r   r(   r_   )r(   r   r   )
r   r   r   r   r   r   r   r_   r(   r   )r(   r  )rT   r   r(   r   )rT   r   r(   r_   )r   r   r(   r)   )r   r<  r(   r_   )r(   r@  )r(   rx  )r(   r  )r(   r   )r  rB   r(   r   )r(   r  )_r   
__future__r   r   collections.abcr   r   r   r   
contextlibr   rk  rP  ospathlibr	   r   r  r   r  typestypingr
   r   rK  _pytestr   _pytest._code.coder   r   r   _pytest._ior   _pytest.compatr   _pytest.configr   _pytest.config.argparsingr   _pytest.fixturesr   r   _pytest.nodesr   r   _pytest.outcomesr   r   _pytest.pathlibr   _pytest.pythonr   _pytest.python_apir   _pytest.warning_typesr   r   typing_extensionsr    r  r  r  r  r  rD   rK   r&   __annotations__rG   rM   r^   rX   r\   rY   ro   rJ  r   r   r   r   r  r#  r'  r]   r   r?  rR  rZ   r  r   r  r  r  r   r   rL   rH   rF   <module>r     s   : : : " " " " " " 



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



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