
    Bhf                    J   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%<   dGd&ZDdHd'ZE	 	 	 	 	 	 dId(ZFdJd)ZGdKd*ZHdJd+ZI G d, d-e      ZJ G d. d/eK      ZLdLd0ZM	 	 	 	 dM	 	 	 	 	 	 	 	 	 dNd1ZN G d2 d3e,      ZOdOd4ZPdPd5ZQdQd6ZR G d7 d8e3      ZSdRd9ZTdSd:ZUe
dTd;       ZV G d< d=e3      ZWdUd>ZXdVd?ZYdWd@ZZdWdAZ[dWdBZ\dXdCZ] e(dDE      dYdF       Z^y)Zz4Discover 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_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,   r2   choicesr3   z--doctest-globappendpatz2Doctests file matching pattern, default: test*.txtdoctestglob)r1   r,   metavarr2   r3   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     Z/var/www/html/Telegram-Engagement-Pod-/env/lib/python3.12/site-packages/_pytest/doctest.pypytest_addoptionrE   F   s    
MM#	   MM=w   OOI&E	OO.   
OOYYH&   
OOA   
OO(/+   
OO'K*      c                     d a y N)RUNNER_CLASS rF   rD   pytest_unconfigurerK   x   s	     LrF   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optionr0   any_is_setup_py_is_main_pyDoctestModulefrom_parent_is_doctestDoctestTextfile)	file_pathparentrO   s      rD   pytest_collect_filer[   ~   s     ]]F5 =='')$k)&<=1
 !,,V),DD  
VY	/**6	*BBrF   c                V    | j                   dk7  ry| j                         }d|v xs d|v S )Nzsetup.pyFs
   setuptoolss	   distutils)name
read_bytes)rN   contentss     rD   rS   rS      s2    yyJ HH$@(@@rF   c                    j                   dv r|j                  j                        ry| j                  d      xs dg}t	        fd|D              S )N)z.txtz.rstTr8   z	test*.txtc              3  6   K   | ]  }t        |        y wrH   r   ).0globrN   s     rD   	<genexpr>z_is_doctest.<locals>.<genexpr>   s     8%$z$%%s   )rP   session
isinitpath	getoptionrR   )rO   rN   rZ   globss    `  rD   rW   rW      sL    {{&&6>>+D+DT+J]+<}E8%888rF   c                     | j                   dk(  S )Nz__main__.py)r]   rM   s    rD   rT   rT      s    99%%rF   c                  $    e Zd Z	 	 	 	 ddZddZy)ReprFailDoctestc                    || _         y rH   )reprlocation_lines)selfrm   s     rD   __init__zReprFailDoctest.__init__   s     #5rF   c                ~    | j                   D ].  \  }}|D ]  }|j                  |        |j                  |       0 y rH   )rm   line
toterminal)rn   twreprlocationlinesrq   s        rD   rr   zReprFailDoctest.toterminal   s:    #'#:#:L% ##B' $;rF   N)rm   z0Sequence[tuple[ReprFileLocation, Sequence[str]]]returnNone)rs   r   rv   rw   )__name__
__module____qualname__ro   rr   rJ   rF   rD   rk   rk      s    5"R5	5
(rF   rk   c                        e Zd Zd fdZ xZS )MultipleDoctestFailuresc                0    t         |           || _        y rH   )superro   failures)rn   r   	__class__s     rD   ro   z MultipleDoctestFailures.__init__   s     rF   )r   z Sequence[doctest.DocTestFailure]rv   rw   )rx   ry   rz   ro   __classcell__r   s   @rD   r|   r|      s    ! !rF   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~   ro   continue_on_failure)rn   r   r   r   r   r   s        rD   ro   z8_init_runner_class.<locals>.PytestDoctestRunner.__init__   s!     GWg;W':D$rF   c                l     j                   |||      }| j                  r|j                  |       y |rH   )DocTestFailurer   r6   )rn   outtestexamplegotfailuredoctests         rD   report_failurez>_init_runner_class.<locals>.PytestDoctestRunner.report_failure   s5     -g,,T7C@G''

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

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

1)(33 rF   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systemrO   pluginmanager	getpluginsuspend_global_captureread_global_capturesysstdoutwritestderr)rn   capmanr   errs       rD   r   z0DoctestItem._disable_output_capturing_for_darwin1  s~    ??(**445EF))d)3113HCJJS!JJS!	 rF   c                   dd l }d }t        |j                  |j                  |j                  f      r|j                  g}n0t        |j                  t
              r|j                  j                  }|t        | !  |      S g }|D ]P  }|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]  \  }}||j                  z   dz   dd|  }}}|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       S tG        |      S c c}}w c c}w )Nr   r   r4   F03d 	   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+   rx   r   _get_checker_get_report_choicerO   rg   	docstring
splitlines	enumeratemaxsourcer6   output_differencer   splitr   from_exc_infor   	tracebackformat_exceptionstriprk   )rn   excinfor   r   rm   r   r   r   r   r   messagert   r   report_choiceru   ixindentrq   inner_excinfor   s                       rD   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%@{{...CLUCSCS!Qq4;;*3/q4CS   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] )rN   r   r   r]   r   s    rD   
reportinfozDoctestItem.reportinfo}  s(    yy$**++z$))-EEErF   )
r]   r?   rZ   DoctestTextfile | DoctestModuler   doctest.DocTestRunnerr   r   rv   rw   )
rZ   r   r]   r?   r   r   r   r   rv   r    rv   rw   )r   zExceptionInfo[BaseException]rv   zstr | TerminalRepr)rv   z.tuple[os.PathLike[str] | str, int | None, str])rx   ry   rz   ro   classmethodrV   r   r   r   r   r   r   r   r   s   @rD   r   r      s     0 &	
  
& 
Y/
Y 	
Y
 &
Y 
Y 

Y 
Y9'4	">3->3 
>3@FrF   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    rD   _get_flag_lookupr    sZ    &==%;;$99!! ' ? ? 11-/)+!
 
rF   c                ^    | j                  d      }t               }d}|D ]
  }|||   z  } |S )Nr(   r   )getinir  )rO   optionflags_strflag_lookup_tableflag_accflags        rD   get_optionflagsr    s>    mm$9:O(*H%d++  OrF   c                R    | j                  d      }|r| j                  d      rd}|S )Nr;   usepdbF)getvalue)rO   r   s     rD   _get_continue_on_failurer    s/     &0M N ??8$"'rF   c                      e Zd ZdZddZy)rX   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-   rx   __main__Fr   r   r   r   r]   r   r   )r   rO   r  rN   	read_textr?   r]   r  r   r   r  DocTestParserget_doctestexamplesr   rV   )rn   r   encodingtextr   r]   rh   r   r   rB   r   s              rD   r.   zDoctestTextfile.collect  s      ;;%%&89yy""8,tyy>yy~~Z(%dkk2# N 8 E	
 '&&(!!$tXqA==))499V4 *   s   DDrv   zIterable[DoctestItem])rx   ry   rz   r   r.   rJ   rF   rD   rX   rX     s    
CrF   rX   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)rb   r   r   s     rD   rd   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     @rD   r   r     s-     P$--PPK01 rF   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    rD   
_is_mockedr1    s     	SMtT	rF   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 rH   )r1  )r   _stopr   s    rD   <lambda>zF_patch_unwrap_mock_aware.<locals>._mock_aware_unwrap.<locals>.<lambda>  s    jo6Tt6TrF   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   `  @rD   _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] | Nonerv   r
   )inspectunwrap)r>  r=  s    @rD   _patch_unwrap_mock_awarerA    sU      ..K JN +F	" (GN%$s   *A> AAAc                      e Zd ZddZy)rU   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)rn   r   source_linesr   s      rD   rP  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._find_lineno  sO     "#x0%c637sM2%nnS1 !7/$ rF   )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)	rn   testsr   r]   modulerQ  rh   seenr   s	           rD   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)rn   rV  objectr   s      rD   r\  zBDoctestModule.collect.<locals>.MockAwareDocTestFinder._from_module)  s2     "&)*C*CD!' !7/??rF   r  )rx   ry   rz   r   version_infopy_ver_info_minormicrois_find_lineno_brokenrP  rT  r\  r   r   s   @rD   MockAwareDocTestFinderrE    s     # 0 0! 4!G+ Q%0OS5E5E5K5Ka5OQ%0OS5E5E5K5Ka5O "
 %( ')  ')
@ 
@ *rF   rb  r:   zunable to import module Fr  r   )r   DocTestFinderr   r   CollectErrorrO   r  r   rN   re   r   parsefactoriesr  r   r   r  findrx   r$  r   rV   r]   )rn   r   rb  rV  finderr   r   r   s           rD   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'  )rx   ry   rz   r.   rJ   rF   rD   rU   rU     s    ZrF   rU   c                 8    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+)
              )
            )
            c                v   t         |   |||      ry|t               z  }|t               z  }|t	               z  }|s|s|sydd}|r& || j
                  |      } || j
                  |      }|r& || j                  |      } || j                  |      }|r| j                  ||      }t         |   |||      S )NTFc                0    t        j                  | d|      S )Nz\1\2)resub)regextxts     rD   remove_prefixeszX_init_checker_class.<locals>.LiteralsOutputChecker.check_output.<locals>.remove_prefixes~  s    vveWc22rF   )ro  zre.Pattern[str]rp  r?   rv   r?   )r~   check_outputr  r  r  _unicode_literal_re_bytes_literal_re_remove_unwanted_precision)	rn   wantr   r   allow_unicodeallow_bytesallow_numberrq  r   s	           rD   rr  z?_init_checker_class.<locals>.LiteralsOutputChecker.check_outputs  s    w#D#{;'*A*CCM%(=(??K&)9);;L \3 &t'?'?F%d&>&>D&t'='=tD%d&<&<cB55dC@7'c;??rF   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ziprC   r   floatr   startend)rn   rv  r   wantsgotsoffsetwgr{  exponent	precisions              rD   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 )  JrF   )rv  r?   r   r?   r   r   rv   r   )rv  r?   r   r?   rv   r?   )rx   ry   rz   rm  compileUNICODErs  rt  VERBOSEr  rr  ru  r   r   s   @rD   LiteralsOutputCheckerrj  U  s^    
 )bjj)CRZZP&BJJ'A2::NRZZ& JJ)

.	@6	rF   r  )r   OutputChecker)r   r  s     rD   _init_checker_classr  R  s"    O 5 5 Ob ! rF   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  rJ   rF   rD   r   r     s     +-?rF   c                 .    ddl }  | j                  d      S )z+Register and return the ALLOW_UNICODE flag.r   Nr	  r   register_optionflagr  s    rD   r  r    s    &7&&77rF   c                 .    ddl }  | j                  d      S )z)Register and return the ALLOW_BYTES flag.r   Nr
  r  r  s    rD   r  r    s    &7&&}55rF   c                 .    ddl }  | j                  d      S )z$Register and return the NUMBER flag.r   Nr  r  r  s    rD   r  r    s    &7&&x00rF   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     rD   r   r     sN      	$W%9%9#W%9%9#W%9%90'2S2S"A 
 rF   re   )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   rJ   rF   rD   r   r     s     6MrF   )rB   r   rv   rw   r  )rY   r	   rZ   r   rv   z&DoctestModule | DoctestTextfile | None)rN   r	   rv   r   )rO   r   rN   r	   rZ   r   rv   r   )rv   ztype[doctest.DocTestRunner]r   )
r   r   r   r   r   r   r   r   rv   r   )rv   zdict[str, int])rO   r   rv   r   )rO   r   rv   r   )r   r   rv   rw   )r   r]  rv   r   )rv   zGenerator[None])rv   ztype[doctest.OutputChecker])rv   zdoctest.OutputChecker)rv   r   )r  r?   rv   r   )rv   zdict[str, Any])_r   
__future__r   r   collections.abcr   r   r   r   
contextlibr   rZ  r?  ospathlibr	   r   rm  r   r   typestypingr
   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  rA   rI   r&   __annotations__rE   rK   r[   rS   rW   rT   rk   r9  r|   r   r   r   r  r  r  rX   r   r1  rA  rU   r  r   r  r  r  r   r   rJ   rF   rD   <module>r     s   : " 
 $ % $ $ %   	   	 
        , / + & ' ! , $ ' #  - ! & ! % / &# % % % +? ( ,  481 8/d ,A9&
(l 
(!i !2l -1 $	)  	
 (CF$ CFL f >2 % %:[F [|T!n(861" 	y rF   