+
     ]i{q  c            	       s   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtHt  ! R R]P4                  4      t] P8                  R 4       tR	 t]! 4       '       d   ^xM^tR
 t R t!]PD                  PG                  R]! 4       4      ]PD                  PG                  RRR.4      ]PD                  PI                  ^R7      R 4       4       4       t%R t&]! 4       t']' EF  t(](PR                  ^ ,          R,          t*R]*9   dB   ](PV                  PY                  ]PD                  P[                  ]P\                  R7      4       Kf  ]*R8X  dB   ](PV                  PY                  ]PD                  P[                  ]P\                  R7      4       K  ]*R8X  d   ^ RI/H0t0 ]Pb                  ! 4       ^ ,          t1]1'       dZ   ]0! ]14      ]0! R4      8  dD   ](PV                  PY                  ]PD                  P[                  ]Pd                  RR7      4       EK1  EK4  EK7  ](PR                  ^ ,          Pg                  R4      R8X  dC   ](PV                  PY                  ]PD                  P[                  ]P\                  R7      4       EK  ]*R8X  dP   ]Ph                  ! 4       R8w  d:   ](PV                  PY                  ]PD                  P[                  R RR!7      4       EK  ]*R8X  g   EK   R"]Pj                  9   g   R#]Pj                  9   g   EK%  ]	P                  R$8X  g   EK9  ]	Pl                  R%,          RQ8  g   EKT  ](PV                  PY                  ]PD                  P[                  R&4      4       EK  	  ]PD                  PG                  R]'4      ]PD                  PI                  ^R7      R' 4       4       t7R( t8R) t9R* t:R+ t;R, t<R- t=R. t>R/ t?R0 t@R1 tA]PD                  P                  ]	P                  R28H  ;'       d    ]P                  ! 4       '       * R3R47      ]PD                  PG                  R5. ]A! 4       O4      R6 4       4       tD]PD                  P                  R"]Pj                  9   R7R47      ]PD                  P                  ]	P                  R88H  R9R47      R: 4       4       tER; tF]PD                  P                  ]	P                  R28g  R<R47      ]PD                  PG                  R]! 4       4      R= 4       4       tGR> tH]! 4       tI]I EFf  t(](PR                  ^ ,          R,          t*]*R?8X  d7   ](PV                  PY                  ]PD                  P                  R@4      4       K[  ]*RA8X  d7   ](PV                  PY                  ]PD                  P                  RB4      4       K  ]*R8X  d7   ](PV                  PY                  ]PD                  P                  RC4      4       K  ]*R8X  g   K  R"]Pj                  9   g   R#]Pj                  9   g   EK  ]	P                  R$8X  g   EK  ]	Pl                  R%,          RQ8  g   EK2  ](PV                  PY                  ]PD                  P[                  R&4      4       EKi  	  ]PD                  PG                  R]I4      ]PD                  PI                  ^R7      RD 4       4       tKRE tL]PD                  PG                  R]! 4       4      RF 4       tMRG tN]PD                  PG                  R]! 4       4      ]PD                  PG                  RHRIRJR/3RKRL^
/3.4      RM 4       4       tORN tP]PD                  P                  ]	P                  R88H  ROR47      ]PD                  PG                  R]! 4       4      ]PD                  PG                  RHRIRJR/3RKRL^
/3.4      RP 4       4       4       tQR# )R    N)Image)_c_internal_utils)ToolToggleBase)subprocess_run_helperis_ci_environmentc                   s<   a a ] tR t^t oRtV 3R ltR tRtVtV ;t	# )_WaitForStringPopenzD
A Popen that passes flags that allow triggering KeyboardInterrupt.
c           
     s   < \         P                  R 8X  d   \        P                  VR&   \        SV `  ! V/ VBR/ \        P                  CRRRR/CR\        P                  RR	/B  R
# )win32Zcreationflagsenv
MPLBACKENDZAggSOURCE_DATE_EPOCH0stdoutZuniversal_newlinesTN)	sysplatform
subprocessZCREATE_NEW_CONSOLEZsuper__init__osenvironZPIPE)selfargskwargs	__class__s   &*,Q/usr/lib64/python3.14/site-packages/matplotlib/tests/test_backends_interactive.pyr   Z_WaitForStringPopen.__init__   so    <<7"&0&C&CF?#	=	= N2::M|U4GM	= ??		= 8<		=    c                s    Rp V P                   P                  ^4      pV'       g   \        RV: 24      hW#,          pVP                  V4      '       g   KT  R# )z%Read until the terminator is reached. z)Subprocess died before emitting expected N)r   ZreadZRuntimeErrorendswith)r   Z
terminatorZbufZc   &&  r   wait_forZ_WaitForStringPopen.wait_for'   sS      #A"?
~NP PHC||J''r    )
__name__
__module____qualname____firstlineno__Z__doc__r   r   __static_attributes__Z__classdictcell__Z__classcell__)r   Z__classdict__s   @@r   r   r      s     =
 
r   r   c                  s   \         P                  R 8H  ;'       d    \        P                  ! 4       '       * p \         P                  R 8H  ;'       d    \        P                  ! 4       '       * p. p. R# Uu. uF  pV.RRRV/3NK  	  upOR# Uu. uF  pVR.RRRV/3NK  	  upOR$ UUu. uF  pR% F  pRR.RRV V 2/3NK  	  K  	  uppOR	.RR
/3NR.RR/3NR.RR/3NR.RR/3N EF  w  rgRpV U	u. uF,  p	\
        P                  P                  V	4      '       d   K*  V	NK.  	  p
p	V
'       d"   RP                  RP                  V
4      4      pMV'       d0   VR,          R
8X  g   VR,          P                  R4      '       d   RpMV '       d   RpMVR,          R8X  d)   \        P                  P                  R4      '       d   RpMjVR,          P                  R4      '       dM    ^ RIpVP                  P!                  4       pVP#                  R4      pVR,          ^,          pV R2V9  d   Rp. pV'       d7   VP'                  \(        P*                  P-                  RV RV 2R7      4       MVR,          P                  R4      '       dF   \         P                  R8X  d1   VP'                  \(        P*                  P/                  RR7      4       MVR,          R
8X  d   R\        P                  9   g   R\        P                  9   da   \         P                  R8X  dL   \         P0                  R,          R&8  d0   VP'                  \(        P*                  P/                  R R7      4       VP'                  / VCR!R"P                  V4      /CV34       EK  	  V# u upi u upi u uppi u up	i   \$         d    . p ELi ; i)'linuxr	   qtaggQT_API	cairocffiZqtcairocairogigtkZtkintertkaggwxwxaggzmatplotlib.backends._macosxmacosxNz{} cannot be imported, z$DISPLAY is unset'$DISPLAY and $WAYLAND_DISPLAY are unsetTF_BUILDzmacosx backend fails on AzureZGtkz.0zno usable GTK bindingsz	Skipping z	 because reasondarwinzgithub #16849GITHUB_ACTIONNi   N%Tk version mismatch on Azure macOS CIBACKEND_DEPS,)PyQt6PySide6PyQt5PySide2)   i   )aggr'   r=   i   )r   r   r   display_is_validZxdisplay_is_valid	importlibutil	find_specformatjoin
startswithr   r   getr(   Z
RepositoryZget_defaultZenumerate_versionsImportErrorappendpytestmarkskipxfailversion_info)Z_is_linux_and_display_invalidZ_is_linux_and_xdisplay_invalidZenvsZqt_apiZversionZrendererdepsr   r2   depZmissingr(   Zgi_repoZavailable_gtk_versionsmarkss                  r   #_get_available_interactive_backendsrR   8   s   %(\\W%< &N &N):)K)K)M%M "&)llg&= 'P 'P*;*M*M*O&O #D EFD& xgx8:DF EFD& $i6:<DF	 $F#'4D WIhZ/H IJ4D K#F [<12 VlD)* VlG,- ,,|X.FG	 "&L$3inn.F.Fs.K33$L,33DIIg4FGF+L!W,|$//55(F*>F(*rzz~~j/I/I4F))%00	K --335)0)C)CE)J&,'*G"~%;;1LL))9SE6(1S)TU))$//CLLH4LLL**/*BC,7*RZZ'?bjj+Hllh&r"W,LL!!)P!QS<<^SXXd^<eDEmn KmFFF M  , *,&	,s0   2NN &N%2'N+N+&N00O Oc                  s    \        4        U Uu. uFF  w  r\        P                  ! / V C. VOR P                  R V P	                  4        4       4      R7      NKH  	  upp # u upp i )Z-c              3   s4   "   T F  w  rV R V 2x  K  	  R# 5i)Z=Nr   )Z.0ZkZv   &  r   Z	<genexpr>Z5_get_testable_interactive_backends.<locals>.<genexpr>|   s     $HKDAs!A3ZKs   )rQ   Zid)rR   rJ   paramrE   Zitems)r   rQ        r   "_get_testable_interactive_backendsrV   y   sa     BCEC
 LLC%HH$HCIIK$HHJCE E Es   AAc                 s  a \         P                  ! 4       ;_uu_ 4       p\        P                  ! R R4      p\        P
                  P                  VR4      oVP                  S4        ! V3R lR\        4      pV P                  P                  P                  pV P                  P                  P                  pVP                  RV4       VP                  RR4       RRR4       R#   + '       g   i     R# ; i)ZLAztest_la_icon.pngc                   s"   < ] tR t^t Z tRtRtR# )5_test_toolbar_button_la_mode_icon.<locals>.CustomToolr   r   N)r   r   r    r!   ZimageZdescriptionr"   )tmp_img_paths   r   
CustomToolrW      s     EKr   rY   ZtestZgroupN)   rZ   )tempfileZTemporaryDirectoryr   Znewr   ZpathrE   Zsaver   canvasmanagertoolmanagertoolbarZadd_tool)figZtempdirZimgrY   r^   r_   rX   s   &     @r   !_test_toolbar_button_la_mode_iconra      s     
	$	$	&	&'iih'ww||G-?@	 	 jj((44**$$,,VZ0) 
'	&	&	&s   B?C((C9	c                  sV  aaa ^ RI p ^ RIp^ RIp^ RIp^ RIp^ RIo^ RIHo ^ RIHp SP                  P                  RRR^/4       SP                  P                  VP                  ! VP                  ^,          4      4       SP                  R,          P                  4       pVP                  R4      '       d   VP                  R 4      '       g   SP!                  4       pSP#                  V4       VR	8w  d<   VP$                  ! \&        4      ;_uu_ 4        SP(                  ! R	R
R7       RRR4       VV3R lpV P*                  P-                  R4      '       d   V! VRR! R,           4       V! R4       SP(                  ! VR
R7       SP/                  4       w  ry\1        VP2                  4      P4                  RV 28X  g   Q hVP2                  P6                  P9                  4       R8X  g   Q hSP                  R,          R8X  d   \;        V4       V	P=                  ^ ^.^^.4       VP2                  P>                  '       d*   VP2                  P>                  PA                  RR^R^4       VP2                  PC                  R4      oSPE                  V! RVP2                  R4      PF                  4       VP2                  PI                  RV3R l4       VP2                  PI                  R\J        4       VPM                  4       p
VPO                  V
RR7       SPQ                  4        SPS                  R4       VPM                  4       pVPO                  VRR7       RV9  d1   RV9  d(   V
PU                  4       VPU                  4       8X  g   Q hR# R# R#   + '       g   i     ELs; i)"r    Npyplot)KeyEventwebagg.open_in_browserFwebagg.port_retriesbackendr>   r*   TZforcec                 s   < SP                   ! V R R7       SP                  4       p\        VP                  4      P                  RV  28X  g   Q hSP                  R4       R# )Trh   matplotlib.backends.backend_allN)usefiguretyper\   r   close)Zalt_backendr`   mplplts   & r   check_alt_backendZ1_test_interactive_impl.<locals>.check_alt_backend   sV    GGKt,**,C$//2;-@A B AIIer   r&   r'   Zsvgri   zFigure 1r_   r^   g      ?g       @Zkey_press_eventZq
draw_eventc                 $   < SP                  4       # Nstart)Zeventtimers   &r   <lambda>Z(_test_interactive_impl.<locals>.<lambda>   s    u{{}r   close_eventZpng)rD         ?qtr+   )r)   Zwebi)+importlib.utiliojsonr   rJ   
matplotlibrc   Zmatplotlib.backend_basesrd   rcParamsupdateZloadsargvlowerr   rF   rl   rn   raisesrH   rk   rB   rC   subplotsrm   r\   r   r]   Zget_window_titlera   plotr_   Zdraw_rubberband	new_timeradd_callbackZ_processmpl_connectprintZBytesIOZsavefigshowpauseZgetvalue)rA   r}   r~   r   rJ   rd   rg   r`   rq   axresultZresult_afterro   rp   rw   s               @@@r   _test_interactive_implr      s   (1LL %q 
 LL

388A;/0ll9%++-Gw'9'9.'I'Ijjl		# g{++t, ,	 >>##K00gcrlW45% GGG4 llnGC

&&,H	*RRRR::..0J>>>
||I-/)#.GGQFQF
zz

**4QA>JJ  $E	x 13::sCLLMJJ<)DEJJ=%0ZZ\FKKuK%HHJ IIcN ::<LKKUK+7t72  L$9$9$;;;;  3_ ,++s   NN(	r   r_   Ztoolbar2r^   )Zrerunsc                 s>   V R ,          R8X  d   VR8X  d   \         P                  ! R4       V R ,          R8X  d   \         P                  ! R4       V R ,          R8X  d   VR8X  d   \         P                  ! R4        \        \        \        P
                  ! RV/4      \        V R	7      pXP                  P                  R4      ^8X  g   Q hR#   \        P                   d;   p\         P                  ! R
\        TP                  4      ,           4        Rp?LnRp?ii ; i)r	   r-   r^   z*toolmanager is not implemented for macosx.r+   2wx backend is deprecated; tests failed on appveyorr,   zMTemporarily deactivated: show() changes figure height and thus fails the testr_   timeoutZ	extra_envz,Subprocess failed to test intended behavior
N
CloseEvent)rJ   rL   _run_helperr   r~   Zdumps_test_timeoutr   CalledProcessErrorfailstrstderrr   count)r   r_   procZerrr   r   test_interactive_backendr      s     <H$m#KKDE
<D HI
<G#=(@ . 	/
"JJ	7+,!	
 ;;\*a///	 (( ;#**o	 	s   <-C D"0DDc                  s   ^ RI Hp  ^ RIp^ RIHp VP                  P                  RRR^/4       VP                  4       w  r4VP                  R4       V ! 4       P                  VP                  . RO4      pVP                  4        VP                  P                  R\        4       V ! 4       P                  VP                  P                  4      pVP                  R4       VP                  4        VP                  4        VP                  R	,          P!                  4       P#                  R
4      '       d   VP                  P%                  4        R# R# )r    )ThreadPoolExecutorNrb   re   Frf   rz   ry   rg   r+   )   r=   i   )Zconcurrent.futuresr   r   rc   r   r   r   r   Zsubmitr   r   r\   r   r   Zdrawrn   r   rF   flush_events)r   ro   rp   r`   r   Zfuture         r   _test_thread_implr     s    5(LL %q  llnGCIIcN!(()<F
MMOJJ=%0!((9FIIcN
MMOIIK
||I$$&11$77

! 8r   r	   r'   )r   r+   r-   )parsez10.16T)r   strictr%   r<   r*   ZCPythonzZPyPy does not support Tkinter threading: https://foss.heptapod.net/pypy/pypy/-/issues/1929)r2   r   r0   r4   r3   r5   r6   c                 sv    \        \        \        V R 7      pVP                  P	                  R4      ^8X  g   Q hR# )r   r   N)r   r   r   r   r   r   r      & r   test_interactive_thread_safetyr   N  s0     (-3OD;;\*a///r   c                  sH   ^ RI p ^ RIHp V P                  P	                  R4      p\        V\        4      '       d   Q hVP                  e   Q hVP                  ^4       VP                  f   Q hV P                  P	                  R4      p\        V\        4      '       g   Q hR# )r    Nrg   )	r   matplotlib.pyplotrc   r   Z_getZ
isinstancer   Z_backend_modr   )r   rp   Zbk      r   &_impl_test_lazy_auto_backend_selectionr   U  s    #				!	!)	,B"c""""###HHQK'''				!	!)	,Bb#r   c                  0    \        \        \        R 7       R# r   N)r   r   r   r   r   r    test_lazy_auto_backend_selectionr   c  s    6%'r   c                      ^ RI p ^ RIpRVP                  9  g   Q hRVP                  9  g   Q hRVP                  9   g   RVP                  9   g   Q hR# R# r    Nr9   pyside6r;   pyside2)Z"matplotlib.backends.backend_qt5aggr   modulesr   r   rU   r   _implqt5aggr   h  sO    -#++%%%CKK'''ckk!Y#++%===%=!r   c                  r   r   )Z$matplotlib.backends.backend_qt5cairor   r   r   rU   r   
_implcairor   q  sO    /#++%%%CKK'''ckk!Y#++%===%=!r   c                  r   r   )Zmatplotlib.backends.backend_qt5r   r   r   rU   r   	_implcorer   z  sO    *#++%%%CKK'''ckk!Y#++%===%=!r   c                  s   R U u. uF(  p \         P                  P                  V 4      f   K&  V NK*  	  pp R U u. uF(  p \         P                  P                  V 4      f   K&  V NK*  	  pp \        V4      ^ 8X  g   \        V4      ^ 8X  d   \        P
                  ! R4       \        \        \        R7       \         P                  P                  R4      e   \        \        \        R7       \        \        \        R7       R# u up i u up i )r;   Nneed both QT6 and QT5 bindingsr   Zpycairo)r;   r   )r9   r   )rA   rB   rC   lenrJ   rL   r   r   r   r   r   )rP   qt5_bindingsqt6_bindingsr   r   test_qt5backends_uses_qt5r     s    ++>>##C( 	+  
 ,+>>##C( 	+   <A\!2a!745]3~~	*6J6	=1s   #DD#D!Dc                  s   ^ RI p RV P                  R&   RV P                  R&   RV P                  R&   RV P                  R&   ^ RIHp \        P
                  ! \        RR7      ;_uu_ 4        VP                  R4       RRR4       \        P
                  ! \        R	R7      ;_uu_ 4        VP                  R
4       RRR4       R#   + '       g   i     LP; i  + '       g   i     R# ; i)r    Nr9   r;   r<   r:   z(Failed to import any of the following Qt)Zmatchr$   z^(?:(?!(PySide6|PyQt6)).)*$Zqt5agg)r   r   r   rc   rJ   r   rH   switch_backend)r   rp   rU   r   _impl_missingr     s    CKKCKK!CKK	!CKK	#	{*T	U	U7# 
V 
{*G	H	H8$ 
I	H 
V	U 
I	H	Hs   +C)CC	C)	c                  r   r   )r   r   r   r   r   r   test_qt_missingr     s    }5r   c                  s^   ^ RI p ^ RIp^ RIpVP                  w  r4pV P                  ! V R24       V P                  ! V R24      p^ RIpV P                  ! V R24      pVP                  R.4      p	VP                  RR\        R7       VP                  P                  P                  4        R# )r    Nz.QtCorez
.QtWidgetszmpl testingerrorz.*Mixing Qt major.*)ZmessageZcategory)rA   r   warningsr   import_moduleZmatplotlib.backends.backend_qtZQApplicationZfilterwarningsZUserWarningZbackendsZ
backend_qtZ_create_qApp)
rA   r   r   _Zhost_bindingZmpl_bindingZmpl_binding_qwidgetsr   Zhost_qwidgetsZhost_apps
             r   _impl_test_cross_Qt_importsr     s    #&88 A[{m734$22k]*3MN)++|nJ,GHM))=/:HG-C%0  2""//1r   c               #   s  "   R U u. uF(  p \         P                  P                  V 4      f   K&  V NK*  	  pp R U u. uF(  p \         P                  P                  V 4      f   K&  V NK*  	  pp \        V4      ^ 8X  g   \        V4      ^ 8X  d<   \        P
                  ! RR\        P                  P                  R4      .R7      x  R# V F  pV F  pW4.WC.3 Rj  xL
  K  	  K  	  R# u up i u up i  L5i)r;   Nr   )rQ   )r;   r<   )r9   r:   )rA   rB   rC   r   rJ   rT   rK   rL   )rP   r   r   Zqt5Zqt6        r   qt5_and_qt6_pairsr     s     ++>>##C( 	+  
 ,+>>##C( 	+   <A\!2a!7ll4"(++"2"23S"T!UW 	WC
SJ///    0s2   C4#C(C(C4#C-#C-)A0C4C2C4r#   r/   r1   z	host, mplc                 s     \        \        W\        R 7      pVP                  pRV9   g   Q hR#   \        P
                   d   pTP                  p Rp?L1Rp?ii ; i)r   Nz2Mixing Qt major versions may not work as expected.)r   r   r   r   r   r   )Zhostro   r   r   Zexs   &&   r   test_cross_Qt_importsr     sU    
	6#02 ?6III ((  	s   / AAAz,this test fails an azure for unknown reasonsr   zCannot send SIGINT on Windows.c                  s   \         P                  ! R 4       \        P                  ! \        P
                  R\        P                  ! \        4      R,           R./ \        P                  CRRRR/CR7      p R	\        P                  R
,           R\        P                  R,           2p\        P                  ! 4       \        ,           p   V P!                  4       pVe   Q h\"        P$                  P'                  V4      p TP/                  4        T P1                  \2        P4                  4       T P7                  \        R7      ^ 8X  g   Q h T P!                  4       f   T P9                  4        R# R#   \"        P(                  P*                   d9    \        P                  ! 4       T8  d   \         P,                  ! R4        K   EK  i ; i  T P!                  4       f   T P9                  4        i i ; i)Ztornado-cz
_test_interactive_impl()z{}r	   Zwebaggr
   r   r   zhttp://zwebagg.addressZ:zwebagg.portNz'Failed to connect to the webagg server.r   )rJ   Zimportorskipr   Popenr   
executableinspect	getsourcer   r   r   ro   r   timeZperf_counterr   ZpollurllibrequestZurlopenr   ZURLErrorr   rn   Zsend_signalsignalSIGINTZwaitkill)r   Zurlr   ZretcodeZconnr   r   test_webaggr     s    	"				1	2'
()-	/ MrzzL<3FL	ND
 CLL!1231S\\-5P4Q
RC!M1G
))+&~~--c2 	

'yyy/144499;IIK  <<(( $$&0KK IJ	 99;IIK s2   	G 5E4  AG 4AGG 
GG %G3c                  sF   ^ RI p ^ RIpVP                  R,          w  r#VP                  R4      pV P                  P                  RR4       V P                  P                  RR4       V F  pWAP                  9  d   K  Q h	  ^ RIHp VP                  4       R8X  g   Q hV F  pWAP                  9  d   K  Q h	  V F+  p\        P                  ! V4       WAP                  9   d   K+  Q h	   VP                  V4       VP                  ! ^4       R#   \         d     R# i ; i)r    N:r   NNr8   DISPLAYWAYLAND_DISPLAYr>   )r   r   r   Zsplitr   popr   r   rc   Zget_backendrA   r   r   ZexitrH   )r   r   rg   rO   rP   rp   r   r   _lazy_headlessr      s    HHRLMG::c?D JJNN9d#JJNN$d+++%%%  $??%%%++%%%  $kk!!! 
7# 	  s   ,D D D zthis a linux-only testc                 s    \        \        V P                  R 4      V P                  R4      \        / V CRRRR/CR7      pR# )r	   r7   r   r   r   r   N)r   r   r   r   r   r   r   test_lazy_linux_headlessr   !  s?     sww~6?S?)R):B?	Dr   c                  s   ^ RI Hp  V P                  4       w  rVP                  ^ ^.^^.RR7      w  pV P	                  RR7       V P                  R4       VP                  P                  R\        4       VP                  P                  VP                  4      pVP                  V4       VP                  P                  VP                  4       \        ^
4       F  pVP                  P                  V4       VP                  ^ ^.^^.4      w  pVP                  V4       VP                  P                  VP                  4       VP                  P                  4        K  	  V P                  R4       R# )	r    NT)ZanimatedF)blockg333333?rr   皙?)r   rc   r   r   r   r   r\   r   r   Zcopy_from_bboxZbboxZdraw_artistZblitZrangeZrestore_regionr   )rp   r`   r   ZlnZbgZjr   r   _test_number_of_draws_scriptr   ,  s   #llnGC ''1a&1a&4'
0CB HH5HIIcNJJ</ 
	"	"388	,BNN2JJOOCHH2Y

!!"% ggq!fq!f%
r

!

!  IIcNr   	gtk3cairoz#gtk3cairo does not support blittingZ	gtk4cairoz#gtk4cairo does not support blittingzwx does not support blittingc                 s    \        \        \        V R 7      pVP                  P	                  R4      p^ Tu;8  d	   ^8  g   Q h Q hR# )r   Z	DrawEventN)r   r   r   r   r   )r   r   ZndrawsrS   r   test_blitting_eventsr   m  sA     $msLD [[{+Fv>>>>r   c                  s`   ^ RI Hp  ^ RIHp RpVP	                  4       pVP                  V4       VP                  P                  R4      pV ! 4       pVP                  V4       VP                  4        VP                  V4       VP                  4        VP                  ^8  g   Q h^ Vn        RVn        VP                  4        VP                  V4       VP                  ^8X  g   Q hVP                  4        VP                  V4       VP                  ^8X  g   Q hVP                  R4       R# )r    )MockNrz   r   Trj   )Zunittest.mockr   r   rc   rl   r   r\   r   r   rv   ZstopZ
call_countsingle_shotrn   )r   rp   Z
pause_timer`   rw   Zmockr   r   _impl_test_interactive_timersr   {  s    
 ##J
**,CIIjJJ  %E6D	t	KKMIIj	JJL??Q DOE	KKMIIj??a 
KKMIIj??aIIer   c                 s    V R ,          R8X  d3   \         P                  ! R4      '       d   \        P                  ! R4       V R ,          R8X  d   \        P                  ! R4       \	        \
        \        V R7       R# )r	   r   ZCIz)gtk3cairo timers do not work in remote CIr+   r   r   N)r   ZgetenvrJ   rL   r   r   r   r   s   &r   test_interactive_timersr     sR    
<K'BIIdOO?@
<D HI-%6r   c                 s  aa	a
 ^ RI o	^ RIHp ^ RIo^ RIpVP                  V 4       VV	3R lp\        W14      pVP                  ^V4      o
VP                  4       pVP                  P                  RR 4       VP                  P                  RV
3R l4        V! R	/ VB  R#   \         d    \        RRR7        R# i ; i)
r    Nc                  s   < SP                   R 8X  d   ^ RIp V P                  ^ ^ 4       R# ^ RIpSP                  ! SP
                  ! 4       VP                  4       R# )r   N)r   win32apiZGenerateConsoleCtrlEventr   r   Zgetpidr   )r   r   r   r   s     r   interrupterZ&_test_sigint_impl.<locals>.interrupter  s=    <<7"--a3GGBIIK/r   rr   c                      \        R RR7      # DRAWTZflushr   r      *r   rx   #_test_sigint_impl.<locals>.<lambda>  s    eF$/r   c                  rs   rt   ru   )r   rw   s   *r   rx   r     s    ekkmr   SUCCESSTr   r   )r   r   rc   r   	threadingr   getattrZTimerrl   r\   r   KeyboardInterruptr   )rg   target_namer   rp   r   r   targetr`   r   r   rw   s   &&&     @@@r   _test_sigint_implr     s    #w0 S&FOOA{+E
**,CJJ/ JJ#% %it$$%s   B# #B?>B?ztarget, kwargsr   r   r   intervalc                 s   V P                  R 4      pVP                  R
4      '       g   \        P                  ! R4       \	        \
        P                  R\        P                  ! \        4      RV: RV: RV: R2,           .4      p VP                  R4       VP                  \        R7      w  rVRT9   g   Q hR	#   \         d%    TP                  4        TP                  4       w  rVh i ; i)r	   -SIGINT currently only tested on qt and macosxr   z
_test_sigint_impl(r.   )r   r   r   Nr{   r-   )rG   rF   rJ   rL   r   r   r   r   r   r   r   communicater   	Exceptionr   )r   r   r   rg   r   r   r   s   &&&    r   test_sigintr     s     ggl#G.//CD				,	-{"VJb
!	D
E	FGDf$$]$;	
 	  		$$&	s   )B< </C+c                 s  a ^ RI p^ RIHp VP                  V 4       \	        WA4      pVP                  4       pVP                  P                  RR 4       VP                  P                  ^R7      oRSn	        SP                  \        RRR7       V3R lpVP                   ! VP                  V4        V! R
/ VB  R#   \         d    \        R	RR7        R# i ; i)r    Nrr   c                  r   r   r   r   r   r   rx   Z7_test_other_signal_before_sigint_impl.<locals>.<lambda>  s    uV47Pr   )r   TSIGUSR1r   c                 s(   < SP                  4        R # rt   ru   )ZsignumZframerw   s   &&r   custom_signal_handlerZD_test_other_signal_before_sigint_impl.<locals>.custom_signal_handler  s    r   r   r   )r   r   rc   r   r   rl   r\   r   r   r   r   r   r   r   )	rg   r   r   r   rp   r   r`   r   rw   s	   &&&     @r   %_test_other_signal_before_sigint_implr     s    #wS&F
**,CJJ<)PQJJ  ! ,EE	uit4
MM&.."78% %it$$%s   4B> >CCz,No other signal available to send on Windowsc                 s   V P                  R 4      pVP                  R4      '       g   \        P                  ! R4       VR8X  d:   VP                  P                  \        P                  P                  RR7      4       \        P                  R8X  dA   VR8X  d:   VP                  P                  \        P                  P                  RR7      4       \        \        P                  R\        P                  ! \        4      R	V: R
V: R
V: R2,           .4      p VP                  R4       \         P"                  ! VP$                  \&        P(                  4       VP                  R4       \         P"                  ! VP$                  \&        P*                  4       VP-                  \.        R7      w  rg\3        T4       RT9   g   Q hR#   \0         d%    TP#                  4        TP-                  4       w  rgh i ; i)r	   r-   r   zmacosx backend is buggyr1   r3   r   zQt backend is buggy on macOSr   z'
_test_other_signal_before_sigint_impl(r.   r   r   r   r   r   Nr   )rG   rF   rJ   rL   ZnodeZ
add_markerrK   rM   r   r   r   r   r   r   r   r   r   r   Zpidr   r   r   r   r   r   r   )r   r   r   r   rg   r   r   r   s   &&&&    r   test_other_signal_before_sigintr     s    ggl#G.//CD( 1 19R 1 ST
||xFf$4
 	KK%CD	F				@	A	3kF:Rz
4
4	56D
	f
&..)i 
&--($$]$;	
 
&M  		$$&	s   BG /G:r?   )RZ	functoolsrA   r|   r   r~   r   r   r   r   r   r[   r   Zurllib.requestr   ZPILr   rJ   r   ro   r   Zmatplotlib.backend_toolsr   Zmatplotlib.testingr   r   r   r   r   Z	lru_cacherR   rV   r   ra   r   rK   ZparametrizeZflakyr   r   Z_thread_safe_backendsrT   Zvaluesrg   rQ   rI   rM   r   Zpackaging.versionr   Zmac_verZTimeoutExpiredrG   Zpython_implementationr   rN   r   r   r   r   r   r   r   r   r   r   r   Zskipifr@   r   r   r   r   r   Z_blit_backendsrL   r   r   r   r   r   r   r   r   r   r   <module>r      s        	    
       ( 3 V*** > = =@E )***.S<l  B DEZ$?@!0  A F0."< ;< "Ell1ol+G' 	KKZ%B%BC	E	DKKZ%B%BC	E	H	+""$Q' uW~g6KK!!)B)B)- " /0 77 
a		X	&)	3KKZ%B%BC	E	G	 > > @I MKKK  	
 W
#"**'D
,,(
"s'7'7';g'EKKEF	H? #F  56!0  70
'
>>>2"% 62$0& LLGHH$5$F$F$H H4  6 &<(9(;&<=J >6J J"**,I  KCLLG+4TU VK<B CLLG+4LM B DE F N&R 45Ell1ol+G+KKBC	E	K	KKBC	E	DKK;<	>
W
#"**'D
,,(
"


2

(KKEF	
% . /!  0@  B DE6 F6%B  B DE)gt_z2, 	 F
$%2 CLLG+I  K B DE)gt_z2, 	 FKr   