
    9[gf                    N   U d Z ddlmZ ddlZddlmZ ddlZddlZddlZddl	m
Z
 ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl&m(Z( ddl)m*Z* ddl)m+Z+ ddl,m-Z- ddl,m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 er
ddl7Z7ddl8m9Z9 d Z:d!Z;d"Z<d#Z=d$Z>e:e;e<e=e>fZ?da@daAd%eBd&<   dHd'ZCdId(ZD	 	 	 	 	 	 dJd)ZEdKd*ZFdLd+ZGdKd,ZH G d- d.e      ZI G d/ d0eJ      ZKdMd1ZL	 	 	 	 dN	 	 	 	 	 	 	 	 	 dOd2ZM G d3 d4e+      ZNdPd5ZOdQd6ZPdRd7ZQ G d8 d9e2      ZRdSd:ZSdTd;ZTedUd<       ZU G d= d>e2      ZVdVd?ZWdWd@ZXdXdAZYdXdBZZdXdCZ[dYdDZ\ e'dEF      dZdG       Z]y)[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                ~   | j                  ddddg       | j                  ddd	       | j                  d
      }|j                  ddddd       |j                  dt        j                  ddt
        d       |j                  ddg ddd       |j                  ddddd       |j                  dddd d!       y )"Ndoctest_optionflagszOption flags for doctestsargsELLIPSIS)typedefaultdoctest_encodingzEncoding used for doctest fileszutf-8)r-   collectz--doctest-modules
store_trueFzRun doctests in all .py modulesdoctestmodules)actionr-   helpdestz--doctest-reportr%   z9Choose another output format for diffs on doctest failuredoctestreport)r,   r-   r3   choicesr4   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r2   r-   metavarr3   r4   z--doctest-ignore-import-errorsz Ignore doctest collection errorsdoctest_ignore_import_errorsz--doctest-continue-on-failurez<For a given doctest, continue to run after the first failuredoctest_continue_on_failure)addinigetgroup	addoptionstrlowerDOCTEST_REPORT_CHOICES)parsergroups     J/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/doctest.pypytest_addoptionrF   F   s    
MM#	   MM=w   OOI&E	OO.   
OOYYH&   
OOA   
OO(/+   
OO'K*      c                     d a y N)RUNNER_CLASS rG   rE   pytest_unconfigurerL   x   s	     LrG   c                   |j                   }| j                  dk(  rM|j                  j                  r6t	        t        |       t        |       f      st        j                  ||       S y t        || |      rt        j                  ||       S y )Nz.pypath)configsuffixoptionr1   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)	file_pathparentrP   s      rE   pytest_collect_filer\   ~   s     ]]F5 =='')$k)&<=1
 !,,V),DD  
VY	/**6	*BBrG   c                V    | j                   dk7  ry| j                         }d|v xs d|v S )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rO   contentss     rE   rT   rT      s2    yyJ HH$@(@@rG   c                    j                   dv r|j                  j                        ry| j                  d      xs dg}t	        fd|D              S )N)z.txtz.rstTr9   z	test*.txtc              3  6   K   | ]  }t        |        y wrI   r   ).0globrO   s     rE   	<genexpr>z_is_doctest.<locals>.<genexpr>   s     8%$z$%%s   )rQ   session
isinitpath	getoptionrS   )rP   rO   r[   globss    `  rE   rX   rX      sL    {{&&6>>+D+DT+J]+<}E8%888rG   c                     | j                   dk(  S )Nz__main__.py)r^   rN   s    rE   rU   rU      s    99%%rG   c                  $    e Zd Z	 	 	 	 ddZddZy)ReprFailDoctestc                    || _         y rI   )reprlocation_lines)selfrn   s     rE   __init__zReprFailDoctest.__init__   s     #5rG   c                ~    | j                   D ].  \  }}|D ]  }|j                  |        |j                  |       0 y rI   )rn   line
toterminal)ro   twreprlocationlinesrr   s        rE   rs   zReprFailDoctest.toterminal   s:    #'#:#:L% ##B' $;rG   N)rn   z0Sequence[tuple[ReprFileLocation, Sequence[str]]]returnNone)rt   r   rw   rx   )__name__
__module____qualname__rp   rs   rK   rG   rE   rl   rl      s    5"R5	5
(rG   rl   c                        e Zd Zd fdZ xZS )MultipleDoctestFailuresc                0    t         |           || _        y rI   )superrp   failures)ro   r   	__class__s     rE   rp   z MultipleDoctestFailures.__init__   s     rG   )r   z Sequence[doctest.DocTestFailure]rw   rx   )ry   rz   r{   rp   __classcell__r   s   @rE   r}   r}      s    ! !rG   r}   c                 >    dd l  G fddj                        } | S )Nr   c                  z     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.
        c                8    t         |   |||       || _        y )N)checkerverboseoptionflags)r   rp   continue_on_failure)ro   r   r   r   r   r   s        rE   rp   z8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s!     GWg;W':D$rG   c                l     j                   |||      }| j                  r|j                  |       y |rI   )DocTestFailurer   r7   )ro   outtestexamplegotfailuredoctests         rE   report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   s5     -g,,T7C@G''

7#rG   c                    t        |d   t              r|d   t        |d   t        j                        rt	        j
                  d        j                  |||      }| j                  r|j                  |       y |)N   zQuitting debugger)	
isinstancer   bdbBdbQuitr   exitUnexpectedExceptionr   r7   )ro   r   r   r   exc_infor   r   s         rE   report_unexpected_exceptionzK_init_runner_class.<locals>.PytestDoctestRunner.report_unexpected_exception   sm     (1+'78qk!(1+s{{3121g11$JG''

7#rG   NNr   T)
r   doctest.OutputChecker | Noner   bool | Noner   intr   boolrw   rx   )r   doctest.DocTestr   doctest.Exampler   r@   rw   rx   )r   r   r   r   r   z>tuple[type[BaseException], BaseException, types.TracebackType]rw   rx   )ry   rz   r{   __doc__rp   r   r   r   )r   r   s   @rE   PytestDoctestRunnerr      s    	 59#' (,	;1	; !	; 		;
 "&	; 	;	 "	 %		
 	 		 "	 %		
 U	 	 	rG   r   )r   DebugRunner)r   r   s    @rE   _init_runner_classr      s!    -g11 -^ rG   c                @    t         
t               a t        | |||      S )Nr   r   r   r   )rJ   r   r   s       rE   _get_runnerr      s-     )+ /	 rG   c                       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 )DoctestItemc                    t         |   ||       || _        || _        d | _        | j
                  j                  }|j                  | d d       }|| _        |j                  | _
        | j                          y )N)nodefunccls)r   rp   runnerdtestobjrf   _fixturemanagergetfixtureinfo_fixtureinfonames_closurefixturenames_initrequest)ro   r^   r[   r   r   fmfixtureinfor   s          rE   rp   zDoctestItem.__init__   ss     	v&
 \\))''T$'G''55rG   c               *    t         |   ||||      S )zThe public named constructor.)r^   r[   r   r   )r   rW   )r   r[   r^   r   r   r   s        rE   rW   zDoctestItem.from_parent  s     w"VFRW"XXrG   c                6    i | _         t        | d      | _        y )NT)	_ispytest)funcargsr   _requestro   s    rE   r   zDoctestItem._initrequest  s    +-"448rG   c                .   | j                   j                          t        | j                   j                        }| j                   j                  d      j	                         D ]
  \  }}|||<    | j
                  j                  j                  |       y )N)
getfixturedoctest_namespace)r   _fillfixturesdictgetfixturevalueitemsr   ri   update)ro   ri   r^   values       rE   setupzDoctestItem.setup   so    ##% = =>==889LMSSUKD%E$K V

&rG   c                    t        | j                         | j                          g }| j                  j	                  | j                  |       |rt        |      y )N)r   )_check_all_skippedr   $_disable_output_capturing_for_darwinr   runr}   )ro   r   s     rE   runtestzDoctestItem.runtest'  sL    4::&11313 	

1)(33 rG   c                J   t        j                         dk7  ry| j                  j                  j	                  d      }|rd|j                  d       |j                         \  }}t        j                  j                  |       t        j                  j                  |       yy)zFDisable output capturing. Otherwise, stdout is lost to doctest (#985).DarwinNcapturemanagerT)in_)platformsystemrP   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)ro   capmanr   errs       rE   r   z0DoctestItem._disable_output_capturing_for_darwin1  s~    ??(**445EF))d)3113HCJJS!JJS!	 rG   c                   dd l }d }t        |j                  |j                  |j                  f      r|j                  g}n0t        |j                  t
              r|j                  j                  }|t        | !  |      S g }|D ]O  }|j                  }|j                  }|j                  }|j                  d }	n|j                  |j                  z   dz   }	t        |      j                  }
t        ||	|
      }t!               }t#        | j$                  j'                  d            }|	|j                  j(                  J |j                  j(                  j+                  d      }|j                  J t-        |      D cg c]  \  }}d||j                  z   dz   |fz   }}}|t/        |j                  dz
  d      |j                  dz    }n=dg}d}|j0                  j+                         D ]  }|j3                  d	| d
|        d} t        ||j                        r0||j5                  ||j6                  |      j9                  d      z  }nnt;        j<                  |j>                        }|d|j                  gz  }|tA        jB                  |j>                   D cg c]  }|jE                  d       c}z  }|j3                  ||f       R tG        |      S c c}}w c c}w )Nr   r   r5   Fz%03d %s	   z?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examplez>>>z???  z...
zUNEXPECTED EXCEPTION: )$r   r   r   r   r   r}   r   r   repr_failurer   r   filenamelinenor,   ry   r   _get_checker_get_report_choicerP   rh   	docstring
splitlines	enumeratemaxsourcer7   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionstriprl   )ro   excinfor   r   rn   r   r   r   r   r   messageru   r   report_choicerv   ixindentrr   inner_excinfor   s                       rE   r   zDoctestItem.repr_failure=  s    	  	 MMG22G4O4OP
  H'>?}}--H7'00GooG<<D}}H{{"w~~597m,,G+HfgFL"nG.t{{/D/D_/UVM!||--999..99%@{{...GPQVGWGWVaIT[[1!4a 88GW   c'..1"4a87>>A;MN V #NN557DLL4xq!78"F 8 '7#9#9:22W[[-%+ !. ; ;G<L<L M2=3F3F2IJKK+4+E+EwGWGW+X+XaAGGDM+X  %%|U&;<S  T 1221(s   !K%'K+c                b    | j                   | j                  j                  d| j                   fS )Nz
[doctest] )rO   r   r   r^   r   s    rE   
reportinfozDoctestItem.reportinfo}  s(    yy$**++z$))-EEErG   )
r^   r@   r[   DoctestTextfile | DoctestModuler   doctest.DocTestRunnerr   r   rw   rx   )
r[   r   r^   r@   r   r   r   r   rw   r!   rw   rx   )r   zExceptionInfo[BaseException]rw   zstr | TerminalRepr)rw   z.tuple[os.PathLike[str] | str, int | None, str])ry   rz   r{   rp   classmethodrW   r   r   r   r   r   r   r   r   s   @rE   r   r      s     0 &	
  
& 
Y/
Y 	
Y
 &
Y 
Y 

Y 
Y9'4	">3->3 
>3@FrG   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_WHITESPACEr+   IGNORE_EXCEPTION_DETAILCOMPARISON_FLAGSALLOW_UNICODEALLOW_BYTESNUMBER)r   r   r  r  r  r+   r  r  _get_allow_unicode_flag_get_allow_bytes_flag_get_number_flagr   s    rE   _get_flag_lookupr    sZ    &==%;;$99!! ' ? ? 11-/)+!
 
rG   c                ^    | j                  d      }t               }d}|D ]
  }|||   z  } |S )Nr)   r   )getinir  )rP   optionflags_strflag_lookup_tableflag_accflags        rE   get_optionflagsr    s>    mm$9:O(*H%d++  OrG   c                R    | j                  d      }|r| j                  d      rd}|S )Nr<   usepdbF)getvalue)rP   r   s     rE   _get_continue_on_failurer    s/     &0M N ??8$"'rG   c                      e Zd ZdZddZy)rY   Nc              #    K   dd l }| j                  j                  d      }| j                  j	                  |      }t        | j                        }| j                  j                  }ddi}t        | j                        }t        d|t               t        | j                              } |j                         }	|	j                  ||||d      }
|
j                  r&t        j                  | |
j                  ||
       y y w)Nr   r.   ry   __main__Fr   r   r   r   r^   r   r   )r   rP   r  rO   	read_textr@   r^   r  r   r   r  DocTestParserget_doctestexamplesr   rW   )ro   r   encodingtextr   r^   ri   r   r   rC   r   s              rE   r/   zDoctestTextfile.collect  s      ;;%%&89yy""8,tyy>yy~~Z(%dkk2# N 8 E	
 '&&(!!$tXqA==))499V4 *   s   DDrw   zIterable[DoctestItem])ry   rz   r{   r   r/   rK   rG   rE   rY   rY     s    
CrG   rY   c                f    ddl t        fd| j                  D              }|rt        d       yy)zVRaise pytest.skip() if all examples in the given DocTest have the SKIP
    option set.r   Nc              3  j   K   | ]*  }|j                   j                  j                  d        , yw)FN)optionsgetSKIP)rc   r   r   s     rE   re   z%_check_all_skipped.<locals>.<genexpr>  s%     P-QaiimmGLL%8-s   03z!all tests skipped by +SKIP option)r   allr$  r   )r   all_skippedr   s     @rE   r   r     s-     P$--PPK01 rG   c                     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    rE   
_is_mockedr1    s     	SMtT	rG   c               #     K   t         j                  dd	 	 	 	 	 dfd} | t         _        	 d t         _        y# t         _        w xY ww)zContext manager which replaces ``inspect.unwrap`` with a version
    that's aware of mock objects and doesn't recurse into them.Nstopc                    	 ||t         u r  t               S |   fd      S # t        $ r'}t        j                  d|d dt                d }~ww xY w)Nr3  c                .    t        |       xs        S rI   )r1  )r   _stopr   s    rE   <lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    jo6Tt6TrG   zGot z when unwrapping z.  This is usually caused by a violation of Python's object protocol; see e.g. https://github.com/pytest-dev/pytest/issues/5080)r1  	Exceptionwarningswarnr    )r   r4  er7  real_unwraps   `  @rE   _mock_aware_unwrapz4_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap  st    	|tz1"4j99Et*TUU 	MMqe,TH 5C C 	 	s   - - 	A"AA)r   zCallable[..., Any]r4  zCallable[[Any], Any] | Nonerw   r   )inspectunwrap)r>  r=  s    @rE   _patch_unwrap_mock_awarerA    sU      ..K JN +F	" (GN%$s   *A> AAAc                      e Zd ZddZy)rV   c              #  r  K   dd l } G d d|j                        }	 | j                  }| j                  j                  j                  |         |       }t        | j
                        }t        d|t               t        | j
                              }|j!                  |j"                        D ]4  }|j$                  st&        j)                  | |j*                  ||       6 y # t        j                  $ r9 | j
                  j                  d      rt        d| j                         n Y 
w xY ww)	Nr   c                  0    e Zd Zej                  dd Zedk  xsB edk(  xr ej                  j                  dk  xs  edk(  xr 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   )rG     rG  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hasattrr?  r@  r   _find_lineno)ro   r   source_linesr   s      rE   rP  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sO     "#x0%c637sM2%nnS1 !7/$ rG   )rG  
   c           
         t        |      ryt               5  t        |   |||||||       ddd       y# 1 sw Y   yxY w)zOverride _find to work around issue in stdlib.

                    https://github.com/pytest-dev/pytest/issues/3456
                    https://github.com/python/cpython/issues/69718
                    N)r1  rA  r   _find)	ro   testsr   r^   modulerQ  ri   seenr   s	           rE   rT  z;DoctestModule.collect.<locals>.MockAwareDocTestFinder._find  s<     "#13!3flE4 433s	   7A )rG     c                p    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)ro   rV  objectr   s      rE   r\  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)  s2     "&)*C*CD!' !7/??rG   r  )ry   rz   r{   r   version_infopy_ver_info_minormicrois_find_lineno_brokenrP  rT  r\  r   r   s   @rE   MockAwareDocTestFinderrE    s     # 0 0! 4!G+ Q%0OS5E5E5K5Ka5OQ%0OS5E5E5K5Ka5O "
 %( ')  ')
@ 
@ *rG   rb  r;   zunable to import module Fr  r   )r   DocTestFinderr   r   CollectErrorrP   r  r   rO   rf   r   parsefactoriesr  r   r   r  findry   r$  r   rW   r^   )ro   r   rb  rV  finderr   r   r   s           rE   r/   zDoctestModule.collect  s    ;	@W%:%: ;	@z	XXF 	$$33D9 ()%dkk2# N 8 E	
 KK8D}}!--tyyt .   9) %% 	{{##$BC/		}=> ?	s/   D7C( BD7 (D7(AD40D73D44D7Nr'  )ry   rz   r{   r/   rK   rG   rE   rV   rV     s    ZrG   rV   c                 F    dd l } dd l G fdd| j                        }|S )Nr   c                       e Zd ZW j                  dW j                        ZW j                  dW j                        ZW j                  dW 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+)
              )
            )
            c                z   t         |   |||      ry|t               z  }|t               z  }|t	               z  }|s|s|syd	fd}|r& || j
                  |      } || j
                  |      }|r& || j                  |      } || j                  |      }|r| j                  ||      }t         |   |||      S )NTFc                *    j                  | d|      S )Nz\1\2)sub)regextxtres     rE   remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes  s    vveWc22rG   )rn  zPattern[str]ro  r@   rw   r@   )r   check_outputr  r  r  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)
ro   wantr   r   allow_unicodeallow_bytesallow_numberrq  r   rp  s
           rE   rr  z?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputt  s    w#D#{;'*A*CCM%(=(??K&)9);;L \3 &t'?'?F%d&>&>D&t'='=tD%d&<&<cB55dC@7'c;??rG   c                .   t        | j                  j                  |            }t        | j                  j                  |            }t        |      t        |      k7  r|S d}t	        ||      D ]!  \  }}|j                  d      }|j                  d      }	|	|j                  d      }	|dn
t        |      }
|	|
t        |	      z  }
t        |j                               t        t        |j                               d|
 z        k(  s|d |j                         |z    |j                         z   ||j                         |z   d  z   }||j                         |j                         z
  |j                         |j                         z
  z
  z  }$ |S )Nr   fraction	exponent1	exponent2rR  )abs)list
_number_refinditerlenziprD   r   floatr   startend)ro   rv  r   wantsgotsoffsetwgr{  exponent	precisions              rE   ru  zM_init_checker_class.<locals>.LiteralsOutputChecker._remove_unwanted_precision  s\   11$78E0056D5zSY&
FE4(1'(wwz':'(ww{';# ww{3H!)!1As8}	'X.I#veAGGI.>B
N'SS
 0aggi&01AGGI=AEEGfDTDV@WW  aeeg	1QUUWqwwy5HIIF )  JrG   )rv  r@   r   r@   r   r   rw   r   )rv  r@   r   r@   rw   r@   )ry   rz   r{   compileUNICODErs  rt  VERBOSEr  rr  ru  r   )r   rp  s   @rE   LiteralsOutputCheckerrj  V  sX    
 !jj)CRZZPJJ'A2::NZZ& JJ)

.	@6	rG   r  )r   rp  OutputChecker)r   r  rp  s     @rE   _init_checker_classr  R  s&    O 5 5 Ob ! rG   c                 6    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  rK   rG   rE   r   r     s     +-?rG   c                 .    ddl }  | j                  d      S )z+Register and return the ALLOW_UNICODE flag.r   Nr	  r   register_optionflagr  s    rE   r  r    s    &7&&77rG   c                 .    ddl }  | j                  d      S )z)Register and return the ALLOW_BYTES flag.r   Nr
  r  r  s    rE   r  r    s    &7&&}55rG   c                 .    ddl }  | j                  d      S )z$Register and return the NUMBER flag.r   Nr  r  r  s    rE   r  r    s    &7&&x00rG   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)keyr   s     rE   r   r     sN      	$W%9%9#W%9%9#W%9%90'2S2S"A 
 rG   rf   )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   rK   rG   rE   r   r     s     6MrG   )rC   r   rw   rx   r  )rZ   r   r[   r   rw   z&DoctestModule | DoctestTextfile | None)rO   r   rw   r   )rP   r   rO   r   r[   r   rw   r   )rw   ztype[doctest.DocTestRunner]r   )
r   r   r   r   r   r   r   r   rw   r   )rw   zdict[str, int])rP   r   rw   r   )rP   r   rw   r   )r   r   rw   rx   )r   r]  rw   r   )rw   zGenerator[None])rw   ztype[doctest.OutputChecker])rw   zdoctest.OutputChecker)rw   r   )r  r@   rw   r   )rw   zdict[str, Any])^r   
__future__r   r   
contextlibr   rZ  r?  ospathlibr   r   r   r   typestypingr   r   r   r	   r
   r   r   r:  _pytestr   _pytest._code.coder   r   r   _pytest._ior   _pytest.compatr   _pytest.configr   _pytest.config.argparsingr   _pytest.fixturesr   r   _pytest.nodesr   r   _pytest.outcomesr   r   _pytest.pathlibr   _pytest.pythonr   _pytest.python_apir   _pytest.warning_typesr    r   typing_extensionsr!   r  r  r  r  r  rB   rJ   r'   __annotations__rF   rL   r\   rT   rX   rU   rl   r9  r}   r   r   r   r  r  r  rY   r   r1  rA  rV   r  r   r  r  r  r   r   rK   rG   rE   <module>r     s   : " 
 %   	   
             , / + & ' ! , $ ' #  - ! & ! % / &# % % % +? ( ,  481 8/d ,A9&
(l 
(!i !2l -1 $	)  	
 (CF$ CFL f >2 % %:[F [|U!p(861" 	y rG   