+
   8            
       F  a  R) t30 t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RItR]P                  9   t]'       d
   ]R*9  d   Rt]P                  P                  ]'       * RR7      t ^ RIHt R	t]
'       d   ^ R
IHt ]P.                  P1                  ]P.                  P3                  ]4      R4      t]P.                  P1                  ]R4      t]P.                  P1                  ]R4      t]P.                  P1                  ]R4      t]P.                  P1                  ]R4      t]P.                  P1                  ]R4      t ]P.                  P1                  ]R4      t!]! ]"4      t#] ^ k R R lt$R R lt%R R lt&]PN                  ! RRR7      R R l4       t(R R lt)R+t*R,t+Rt,]P                  PZ                  ]P                  P                  ]RR7      ]P                  P]                  R ])! ]]4      4      R! R" l4       4       4       t/]P                  PZ                  ]P                  P                  ]RR7      ]P                  P]                  R ])! ]4      4      R# R$ l4       4       4       t0]P                  Pc                  R%4      ]P                  PZ                  ]P                  P                  ]RR7      ]P                  Pc                  R&4      ]P                  P]                  R ])! ]4      4      R' R( l4       4       4       4       4       t2R#   ] d    Rt ELi ; i)-    N)defaultdict)TYPE_CHECKINGNPY_RUN_MYPY_IN_TESTSUITETz#`NPY_RUN_MYPY_IN_TESTSUITE` not set)reason)apiF)ParameterSetdatapassfailrevealmisczmypy.iniz.mypy_cachec                0    V ^8  d   QhR\         R\         /# )   keyreturnstr)formats   "C/usr/lib/python3.14/site-packages/numpy/typing/tests/test_typing.py__annotate__r   2   s     6 63 63 6    c                    \         P                  P                  V 4      w  r\         P                  P                  WP	                  R^4      ^ ,          4      # )zqSplit at the first occurrence of the ``:`` character.

Windows drive-letters (*e.g.* ``C:``) are ignored herein.
:)ospath
splitdrivejoinsplit)r   drivetails   &  r   	_key_funcr!   2   s=    
 ''$$S)KE77<<zz#q1!455r   c                R    V ^8  d   QhR\         R\        \        \         3,          /# )r   msgr   )r   tupleint)r   s   "r   r   r   ;   s"     $ $ $sCx $r   c                    \         P                  P                  V 4      w  rVP                  R^4      w  rp \	        V4      V P                  4       3# )z7Strip the filename and line number from a mypy message.r   )r   r   r   r   r%   strip)r#   _r    linenos   &   r   _strip_filenamer*   ;   sA    gg  %GAZZQ'NAsv;		##r   c                Z    V ^8  d   QhR\         P                  \        ,          R\        /# )r   matchr   )reMatchr   )r   s   "r   r   r   B   s"      bhhsm  r   c                0    V P                  4       ^,          # )z4`re.sub` helper function for stripping module names.)groups)r,   s   &r   
strip_funcr1   B   s    <<>!r   module)scopeautousec                    V ^8  d   QhRR/# r   r   N )r   s   "r   r   r   H   s     *  * $ * r   c                    \         P                  P                  \        4      '       dJ   \	        \         P
                  P                  RR4      4      '       d   \        P                  ! \        4       \        P                  ! R4      p \        \        \        \        3 F  p\        P                   ! R\"        R\        V.4      w  r#pV'       d   \$        P&                  ! RV 2R4       M$VR9  d   \$        P&                  ! RV R	V 2R4       R
pRpVP)                  R4       F[  pRV9   d   K  Vf   \+        V4      pWW R2,          pV P-                  V4      f   K;  \.        V,          P1                  V4       R
pRpK]  	  K  	  R# )zClears the cache and run mypy before running any of the typing tests.

The mypy results are cached in `OUTPUT_MYPY` for further use.

The cache refresh can be skipped using

NUMPY_TYPING_TEST_CLEAR_CACHE=0 pytest numpy/typing/tests
NUMPY_TYPING_TEST_CLEAR_CACHETz(\s+)?\^(\~+)?z--config-filez--cache-dirz Unexpected mypy standard error

FzUnexpected mypy exit code: z

 N
znote:>   r      )r   r   isdir	CACHE_DIRboolenvirongetshutilrmtreer-   compilePASS_DIR
REVEAL_DIRFAIL_DIRMISC_DIRr   runMYPY_INIpytestr   r   r!   r,   OUTPUT_MYPYappend)split_pattern	directorystdoutstderr	exit_code
str_concatfilenameis           r   run_mypyrV   G   s9    	i   ?FGGi JJ01M
Hh?	$'GG-
 %!	 KK<VHEuMf$KK5i[VHMuU
#d#A!|$Q<Cr("J""1%1H%,,Z8
 $! @r   c                >    V ^8  d   QhR\         R\        R,          /# )r   directoriesr   r   )r   list)r   s   "r   r   r   u   s       n)= r   c            
      L   . pV  F  p\         P                  ! V4       F~  w  r4pV Fr  p\         P                  P                  V4      w  rxVR9  d   K-  \         P                  P	                  W64      p	VP                  \        P                  ! WR7      4       Kt  	  K  	  K  	  V# ).pyi)id)r[   z.py)r   walkr   splitextr   rM   rK   param)
rX   
test_casesrO   rootr(   filesfnameshort_fnameextfullpaths
   *         r   get_test_casesrg   u   s    J 	 ggi0NDU#%77#3#3E#: o-77<<4!!&,,x"HI  1 ! r   z{}:{} - reveal mismatch:

{}zMypy is not installedr   c                    V ^8  d   QhRR/# r6   r7   )r   s   "r   r   r      s     8 8t 8r   c                 n   \         pW9  d   R # \        P                  P                  V 4      p. pW,           FH  p\	        V4      w  rVVP                  R4      P                  4       pVP                  V RV RV 24       KJ  	  V'       d*   \        P                  ! RP                  V4      RR7       R # R # )Nzerror:r   z - r;   Fpytrace)rL   r   r   relpathr*   removeprefixlstriprM   rK   r   r   )r   output_mypyrl   messagesmessager)   contents   &      r   	test_passrs      s    
 Kggood#G H$$)'2&&x07797)1VHCy9: %
 DIIh'7 r   c                (    V ^8  d   QhR\         RR/# r   r   r   Nr   )r   s   "r   r   r      s     , ,c ,d ,r   c                   Rp\         pW9  d   R# \        P                  P                  V 4      p. pW ,           FR  p\	        V4      w  rg\
        P                  ! V\        4      p\        P                  W6V4      pVP                  V4       KT  	  V'       d0   \        P                  V4      p	\        P                  ! V	RR7       R# R# )zSValidate that mypy correctly infers the return-types of
the expressions in `path`.
TNFrj   )rL   r   r   rl   r*   textwrapindent_FAIL_INDENT_FAIL_MSG_REVEALr   rM   	_FAIL_SEPr   rK   r   )
r   __tracebackhide__ro   rl   failures
error_liner)   	error_msgr   reasonss
   &         r   test_revealr      s     Kggood#G H!''
+J7OOI|<	!(()D	 ( ..*GU+ r   zignore::DeprecationWarningz1ignore:numpy.fix is deprecated:DeprecationWarningc                (    V ^8  d   QhR\         RR/# ru   r   )r   s   "r   r   r      s     ) ) ) )r   c                N   \         P                  P                  V 4      w  rV P                  \         P                  4      RR w  r4\
        P                  P                  V RV 2V 4      p\
        P                  P                  V4      pVP                  P                  V4       R# )z9Validate that the code in `path` properly during runtime.N.)r   r   r^   r   sep	importlibutilspec_from_file_locationmodule_from_specloaderexec_module)r   path_without_extensionr(   dirnamerT   spectest_modules   &      r   test_code_runsr      s     !# 0 0 6

266*23/G>>11)1XJD ..11$7KKKK(r   c                x    V ^8  d   Qh/ ^ \         9   d&   \        \        \        \        ,          3,          ;R&   # )r   rL   )__conditional_annotations__r   r   rY   )r   s   "r   r   r      s)      \ = <[d3i( <] r   )0r:   falsez    zR
_______________________________________________________________________________

)4r   importlib.utilr   r   r-   rB   rw   collectionsr   typingr   rK   r@   RUN_MYPYmarkskipif
pytestmarkmypyr   NO_MYPYImportError_pytest.mark.structuresr   r   r   r   __file__DATA_DIRrE   rG   rF   rH   rJ   r>   rY   rL   r!   r*   r1   fixturerV   rg   ry   r{   rz   slowparametrizers   r   filterwarningsr   r   )r   s   @r   <module>r      s     	 	   #   
 '"**4 22H [[L0   
 G 577<<16:77<<&)77<<&)WW\\(H-
77<<&)77<<*-GGLL=1	 ,7t+< <6$
 h-*  .* Z $	 
 G$;<(!CD8 E = 8( G$;<
!;<, = = ,2 89G$;<OP!9:) ; Q =  :
)Q  Gs   .L 	L L 