+
    Bi                        ^ RI t ^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHt ^ RIHtHtHtHtHtHtHtHtHtHtHt Rt]P8                  ],          tR	],          tRR
 lt ]PB                  s"]PF                  t$ ! R R]%4      t&R],          t']&3R lt( ! R R]%4      t) ! R R]PT                  4      t+]R8X  d   ]PX                  ! 4        R# R# )    N)OrderedDict)support)	SomeClassis_instance)DirsOnSysPath)uncache)NonCallableMockCallableMixinsentinel	MagicMockMockNonCallableMagicMockpatch_patchDEFAULTcall_get_targetbuiltinsz%s.PTModulec                 v   a   ! V 3R  lR\         4      pV'       g   V 3R lpV 3R lpW2n        WBn        V! 4       # )c                   .   <a  ] tR t^t o V3R ltRtV tR# )_get_proxy.<locals>.Proxyc                   < \        SV4      # N)getattrselfnameobjs   &&</usr/lib/python3.14/test/test_unittest/testmock/testpatch.py__getattr__%_get_proxy.<locals>.Proxy.__getattr__   s    3%%     N)__name__
__module____qualname____firstlineno__r    __static_attributes____classdictcell__)__classdict__r   s   @r   Proxyr      s     	& 	&r"   r+   c                     < \        SW4       R # r   )setattr)r   r   valuer   s   &&&r   __setattr___get_proxy.<locals>.__setattr__"   s    C%r"   c                     < \        SV4       R # r   )delattrr   s   &&r   __delattr___get_proxy.<locals>.__delattr__$   s    Cr"   )objectr/   r3   )r   get_onlyr+   r/   r3   s   f&   r   
_get_proxyr7      s1    & & 	&	''7Nr"   c                   l   a  ] tR t^0t o R tR tR tRt]R 4       t	]
R 4       t ! R R]4      tR	tV tR
# )Fooc                    R # r   r#   r   as   &&r   __init__Foo.__init__1   s    4r"   c                    R # r   r#   r;   s   &&r   fFoo.f2   s    Dr"   c                    R # r   r#   r   s   &r   gFoo.g3   s    r"   barc                     R # r   r#   r#   r"   r   static_methodFoo.static_method6   s    r"   c                    R # r   r#   )clss   &r   class_methodFoo.class_method9   s    r"   c                   &   a  ] tR t^<t o R tRtV tR# )Foo.Barc                    R # r   r#   rC   s   &r   r<   	Foo.Bar.a=   s    Tr"   r#   Nr$   r%   r&   r'   r<   r(   r)   r*   s   @r   BarrO   <   s     r"   rT   r#   N)r$   r%   r&   r'   r=   r@   rD   foostaticmethodrH   classmethodrL   r5   rT   r(   r)   rS   s   @r   r9   r9   0   s@     
C  f  r"   r9   z%s.Fooc                     R # r   r#   r<   bs   &&r   functionr[   B   s    r"   c                   >   a  ] tR t^Et o R tR tR tR tR tRt	V t
R# )	Containerc                    / V n         R # r   valuesrC   s   &r   r=   Container.__init__F   s	    r"   c                (    V P                   V,          # r   r_   r   r   s   &&r   __getitem__Container.__getitem__I   s    {{4  r"   c                "    W P                   V&   R # r   r_   )r   r   r.   s   &&&r   __setitem__Container.__setitem__L   s    !Dr"   c                     V P                   V R # r   r_   rc   s   &&r   __delitem__Container.__delitem__O   s    KKr"   c                ,    \        V P                  4      # r   )iterr`   rC   s   &r   __iter__Container.__iter__R   s    DKK  r"   r_   N)r$   r%   r&   r'   r=   rd   rg   rj   rn   r(   r)   rS   s   @r   r]   r]   E   s#     !"! !r"   r]   c                     a  ] tR t^Wt o R}R ltR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0 t3R1 t4R2 t5R3 t6R4 t7R5 t8R6 t9R7 t:R8 t;R9 t<R: t=R; t>R< t?R= t@R> tAR? tBR@ tCRA tDRB tERC tFRD tGRE tHRF tIRG tJRH tKRI tLRJ tMRK tNRL tORM tPRN tQRO tRRP tSRQ tTRR tURS tVRT tWRU tXRV tYRW tZRX t[RY t\RZ t]R[ t^R\ t_R] t`]a! R^R_4      R` 4       tb]a! R^Ra4      Rb 4       tcRc tdRd teRe tfRf tgRg thRh tiRi tjRj tkRk tlRl tmRm tnRn toRo tpRp tqRq trRr tsRs ttRt tuRu tvRv twRw txRx tyRy tzRz t{R{t|V t}R|# )~	PatchTestc                    \         pV'       g   \        pV P                  \        V4       V P	                  \        W4      4       V P                  \        V\        4      4       R # r   )r   r	   assertRaises	TypeError
assertTruer   assertFalser
   )r   r   magic	MockClasss   &&& r   assertNotCallablePatchTest.assertNotCallableY   sE    (	'I)S)C34S-89r"   c                   a a  ! R  R\         4      o\        P                   ! SR\        P                  4      VV 3R l4       pV! 4        S P	                  SP
                  \        P                  R4       R# )c                   .    ] tR t^dt]P
                  tRtR# )4PatchTest.test_single_patchobject.<locals>.Somethingr#   Nr$   r%   r&   r'   r   Original	attributer(   r#   r"   r   	Somethingr}   d        ))Ir"   r   r   c                  ^   < SP                  S P                  \        P                  R 4       R# 	unpatchedNassertEqualr   r   Patchedr   r   s   r   test/PatchTest.test_single_patchobject.<locals>.testg   s!    Y00(2B2BKPr"   patch not restoredNr5   r   r   r   r   r   r   r   r   r   s   f @r   test_single_patchobject!PatchTest.test_single_patchobjectc   sa    	* 	* 
ih.>.>	?	Q 
@	Q 	,,h.?.?-	/r"   c                    R pV P                  \        V4      ;_uu_ 4        \        P                  ! RR4       RRR4       R#   + '       g   i     R# ; i)z>'Something' must be the actual object to be patched, not a strr   do_somethingN)assertRaisesRegexrt   r   r5   )r   msgs   & r   &test_patchobject_with_string_as_target0PatchTest.test_patchobject_with_string_as_targeto   s7    N##Is33LLn5 4333s   AA	c                   a a  ! R  R\         4      o\        P                   ! SRR4      VV 3R l4       pV! 4        S P                  SP                  \        P
                  R4       R# )c                   .    ] tR t^ut]P
                  tRtR# )7PatchTest.test_patchobject_with_none.<locals>.Somethingr#   Nr~   r#   r"   r   r   r   u   r   r"   r   r   Nc                  @   < SP                  S P                  R 4       R# r   )assertIsNoner   r   s   r   r   2PatchTest.test_patchobject_with_none.<locals>.testx   s    i11;?r"   r   )r5   r   r   r   r   r   r   s   f @r   test_patchobject_with_none$PatchTest.test_patchobject_with_nonet   sZ    	* 	* 
id	3	@ 
4	@ 	,,h.?.?-	/r"   c                  a a  ! R  R\         4      o\        P                   ! SR\        P                  4      \        P                   ! SR\        P                  4      VV 3R l4       4       pV! 4        S P                  SP                  \        P                  R4       S P                  SP                  \        P                  R4       R# )c                   F    ] tR t^t]P
                  t]P                  tRt	R# )6PatchTest.test_multiple_patchobject.<locals>.Somethingr#   N
r$   r%   r&   r'   r   r   r   	Original2next_attributer(   r#   r"   r   r   r           ))I%//Nr"   r   r   r   c                     < SP                  S P                  \        P                  R 4       SP                  S P                  \        P
                  R 4       R# r   )r   r   r   r   r   Patched2r   s   r   r   1PatchTest.test_multiple_patchobject.<locals>.test   sG     Y00(2B2B(*Y55x7H7H(*r"   r   N)
r5   r   r   r   r   r   r   r   r   r   r   s   f @r   test_multiple_patchobject#PatchTest.test_multiple_patchobject   s    	0 	0 
ih.>.>	?	i!183D3D	E	* 
F 
@	* 	,,h.?.?-	/1183E3E-	/r"   c                    \         p\        R \        ,          \        P                  4      R 4       p \        P
                  s V! 4        V P                  \         \        P
                  4       Vs R#   Ts i ; i)%s.somethingc                      R # r   r#   r#   r"   r   r   8PatchTest.test_object_lookup_is_quite_lazy.<locals>.test       r"   N)	somethingr   r$   r   
Something2replacement_valuer   r   originalr   s   &  r    test_object_lookup_is_quite_lazy*PatchTest.test_object_lookup_is_quite_lazy   sa    	~((*=*=	>	 
?		! 22IFY(B(BC IIs   ;A2 2A6c                  a  \        R \        ,          \        P                  4      V 3R l4       pV! 4        S P	                  \
        P                  \        P                  R4       \        R \        ,          \        P                  4      \        R\        ,          \        P                  4      V 3R l4       4       pS P	                  \
        P                  \        P                  R4       S P	                  \
        P                  \        P                  R4       V! 4        S P	                  \
        P                  \        P                  R4       S P	                  \
        P                  \        P                  R4       \        4       p\        P                  Vn        \        R\        ,          V4      V 3R l4       pV! 4        V! 4        S P                  \        VR4       R# )r   c                  f   < S P                  \        P                  \        P                  R 4       R# r   )r   PTModuler   r   r   rC   s   r   r   "PatchTest.test_patch.<locals>.test   s$    X//1D1D(*r"   r   z%s.something_elsec                     < S P                  \        P                  \        P                  R 4       S P                  \        P
                  \        P                  R 4       R# r   )r   r   r   r   r   something_elseSomethingElserC   s   r   r   r      sG     X//1D1D(*X44h6L6L(*r"   %s.openc                  ^   < S P                  \        R R4      \        P                  R4       R# )filenamerzopen not patchedN)r   openr   HandlerC   s   r   r   r      s#    T*c2HOO/1r"   N)r   r$   r   r   r   r   r   r   r   r   r   r   return_valuebuiltin_stringassertNotEqualr   )r   r   mocks   f  r   
test_patchPatchTest.test_patch   sp   	~((*=*=	>	* 
?	* 	++X-?-?-	/ 
~((*=*=	>	"X-x/E/E	F	* 
G 
?	* 	++X-?-?-	/00(2H2H-	/ 	++X-?-?-	/00(2H2H-	/ v$OO	y>)4	0	1 
1	1 	D$(<=r"   c                   a  \        R \        ,          \        P                  4      V 3R l4       pV! 4        S P	                  \
        P                  P                  R4       R# )z%s.SomeClass.class_attributec                  z   < S P                  \        P                  P                  \        P
                  R 4       R# r   )r   r   r   class_attributer   ClassAttributerC   s   r   r   2PatchTest.test_patch_class_attribute.<locals>.test   s-     X//??%44kCr"   r   N)r   r$   r   r   r   r   r   r   r   r   s   f r   test_patch_class_attribute$PatchTest.test_patch_class_attribute   sS    	-8&&
(	C
(	C 	(,,<<.	0r"   c                  a aaa  ! R  R\         4      o\        P                   ! SR4      VV 3R l4       pV! 4        \        P                   ! SR4      \        P                   ! SR4      VVVV 3R l4       4       pR;ooV! \        P                  \        P                  4      w  ooV! \        P                  \        P                  4       R# )c                   F    ] tR t^t]P
                  t]P                  tRt	R# ):PatchTest.test_patchobject_with_default_mock.<locals>.Testr#   N)
r$   r%   r&   r'   r   r   r   r   
something2r(   r#   r"   r   Testr      s     ))I!++Jr"   r   r   c                 p   < SP                  V SP                  R 4       SP                  V \        R4       R# )"Mock not passed into test function.patch with two arguments did not create a mockN)r   r   assertIsInstancer   )r   r   r   s   &r   r   :PatchTest.test_patchobject_with_default_mock.<locals>.test   s3    T4>>AC!!$	LNr"   r   c                   < SP                  V \        P                  R 4       SP                  V\        P                  R4       SP                  VSP                  R4       SP                  VSP
                  R4       SP                  V\        R4       SP                  V\        R4       SP                  SVR4       SP                  SVR4       W#3# )z0Patched function didn't receive initial argumentz/Patched function didn't receive second argumentr   z)Second Mock not passed into test functionr   zunexpected value for mock1)	r   r   this1this2r   r   r   r   r   )r   r   mock1mock2r   
outerMock1
outerMock2r   s   &&&&r   r   r      s     UHNNOQUHNNNPUDOOACUDNNHJ!!%LN!!%LN 
E3OP
E3OP<r"   N)r5   r   r   r   r   )r   r   r   r   r   s   f @@@r   "test_patchobject_with_default_mock,PatchTest.test_patchobject_with_default_mock   s    	,6 	, 
dK	(	N 
)	N 		dK	(	dL	)	  
* 
)	 & #'&
Z!%hnnhnn!E
J 	X^^X^^,r"   c                `   a  \        R \        ,          \        R7      V 3R l4       pV! 4        R# )%s.SomeClassspecc                    < SP                  \        V 4       SP                  \        \        P                  \
        4      4       SP                  \        R  4       R# )c                  "    \         P                  # r   r   
not_wibbler#   r"   r   <lambda>>PatchTest.test_patch_with_spec.<locals>.test.<locals>.<lambda>
  
    i6J6Jr"   Nr   r   ru   r   wibbler   rs   AttributeErrorMockSomeClassr   s   &r   r   ,PatchTest.test_patch_with_spec.<locals>.test  =    Y6OOK	(8(8)DEn.JKr"   N)r   r$   r   r   s   f r   test_patch_with_specPatchTest.test_patch_with_spec  s*    	~(y	9	L 
:	L
 	r"   c                j   a  \         P                  ! \        R \        R7      V 3R l4       pV! 4        R# )r   r   c                    < SP                  \        P                  V 4       SP                  \	        \        P                  P
                  \        4      4       SP                  \        R  4       R# )c                  6    \         P                  P                  # r   r   r   r   r#   r"   r   r   DPatchTest.test_patchobject_with_spec.<locals>.test.<locals>.<lambda>      i&?&?&J&Jr"   N	r   r   r   ru   r   r   r   rs   r   MockAttributer   s   &r   r   2PatchTest.test_patchobject_with_spec.<locals>.test  Q    Y66FOOK	(A(A(H(H'02 3nJLr"   Nr   r5   r   r   s   f r   test_patchobject_with_spec$PatchTest.test_patchobject_with_spec  s-    	i!2	C	L 
D	L 	r"   c                Z   a  \        R \        ,          R.R7      V 3R l4       pV! 4        R# )r   r   r   c                    < SP                  \        V 4       SP                  \        \        P                  \
        4      4       SP                  \        R  4       R# )c                  "    \         P                  # r   r   r#   r"   r   r   FPatchTest.test_patch_with_spec_as_list.<locals>.test.<locals>.<lambda>   r   r"   Nr   r   s   &r   r   4PatchTest.test_patch_with_spec_as_list.<locals>.test  r   r"   Nr   r$   r   s   f r   test_patch_with_spec_as_list&PatchTest.test_patch_with_spec_as_list  s,    	~(z	:	L 
;	L
 	r"   c                d   a  \         P                  ! \        R R.R7      V 3R l4       pV! 4        R# )r   r   r   c                    < SP                  \        P                  V 4       SP                  \	        \        P                  P
                  \        4      4       SP                  \        R  4       R# )c                  6    \         P                  P                  # r   r   r#   r"   r   r   LPatchTest.test_patchobject_with_spec_as_list.<locals>.test.<locals>.<lambda>,  r   r"   Nr   r   s   &r   r   :PatchTest.test_patchobject_with_spec_as_list.<locals>.test&  r  r"   Nr  r   s   f r   "test_patchobject_with_spec_as_list,PatchTest.test_patchobject_with_spec_as_list%  s/    	i!2(	D	L 
E	L 	r"   c                   a  \        R \        ,          4      \        R\        ,          R.R7      V 3R l4       4       pV! 4        R# )r   r   r   r   c                    < SP                  \        V 4       SP                  \        \        P                  \
        4      4       SP                  \        R  4       R# )c                  "    \         P                  # r   r   r#   r"   r   r   MPatchTest.test_nested_patch_with_spec_as_list.<locals>.test.<locals>.<lambda>8  r   r"   Nr   )r   MockOpenr   s   &&r   r   ;PatchTest.test_nested_patch_with_spec_as_list.<locals>.test3  s?     Y6OOK	(8(8)DEn.JKr"   N)r   r   r$   r   s   f r   #test_nested_patch_with_spec_as_list-PatchTest.test_nested_patch_with_spec_as_list1  s>    	y>)	*	~(z	:	L 
; 
+	L 	r"   c                X   a  \        R \        ,          RR7      V 3R l4       pV! 4        R# )r   Tr   c                    <a  SP                  \        S 4       S P                   SP                  \        V 3R  l4       R# )c                     < S P                   # r   r   r   s   r   r   IPatchTest.test_patch_with_spec_as_boolean.<locals>.test.<locals>.<lambda>C      m6N6Nr"   Nr   r   r   rs   r   r   s   fr   r   7PatchTest.test_patch_with_spec_as_boolean.<locals>.test=  -    Y6  n.NOr"   Nr  r   s   f r   test_patch_with_spec_as_boolean)PatchTest.test_patch_with_spec_as_boolean<  s*    	~(t	4	P 
5	P 	r"   c                b   a  \         P                  ! \        R RR7      V 3R l4       pV! 4        R# )r   Tr   c                    <a  SP                  \        S 4       S P                   SP                  \        V 3R  l4       R# )c                     < S P                   # r   r!  r"  s   r   r   PPatchTest.test_patch_object_with_spec_as_boolean.<locals>.test.<locals>.<lambda>O  r$  r"   Nr%  r   s   fr   r   >PatchTest.test_patch_object_with_spec_as_boolean.<locals>.testI  r'  r"   N)r   r5   r   r   s   f r   &test_patch_object_with_spec_as_boolean0PatchTest.test_patch_object_with_spec_as_booleanH  s+    	h$	7	P 
8	P 	r"   c                X   a  \        R \        ,          RR7      V 3R l4       pV! 4        R# )r   Tr   c                    <a SP                  \        V \        4      4       V ! 4       oSP                  S4       SP                   SP                  \        V3R  l4       R# )c                     < S P                   # r   r!  )instances   r   r   VPatchTest.test_patch_class_acts_with_spec_is_inherited.<locals>.test.<locals>.<lambda>]  s    h6I6Ir"   N)ru   r   r   ry   r   rs   r   )r   r4  r   s   &@r   r   DPatchTest.test_patch_class_acts_with_spec_is_inherited.<locals>.testU  sC    OOKyAB$H""8,OOn.IJr"   Nr  r   s   f r   ,test_patch_class_acts_with_spec_is_inherited6PatchTest.test_patch_class_acts_with_spec_is_inheritedT  s*    	~(t	4	K 
5	K 	r"   c                   a  \        R \        ,          \        P                  RR7      V 3R l4       pV! 4        S P	                  \
        R 4       R# )
%s.froobleTcreatec                  P   < S P                  \        \        P                  4       R # r   )r   froobler   FrooblerC   s   r   r   LPatchTest.test_patch_with_create_mocks_non_existent_attributes.<locals>.testc  s    Wh&6&67r"   c                      \         # r   r>  r#   r"   r   r   PPatchTest.test_patch_with_create_mocks_non_existent_attributes.<locals>.<lambda>h      Wr"   N)r   r   r   r?  rs   	NameErrorr   s   f r   4test_patch_with_create_mocks_non_existent_attributes>PatchTest.test_patch_with_create_mocks_non_existent_attributesb  sA    	|n,h.>.>t	L	8 
M	8 	)_5r"   c                   a  \         P                  ! \        R \        P                  RR7      V 3R l4       pV! 4        S P                  \        R 4       R# )r>  Tr;  c                  d   < S P                  \        P                  \        P                  4       R # r   )r   r   r>  r   r?  rC   s   r   r   RPatchTest.test_patchobject_with_create_mocks_non_existent_attributes.<locals>.testl  s    Y..0@0@Ar"   N)r   r5   r   r   r?  assertNotHasAttrr   s   f r   :test_patchobject_with_create_mocks_non_existent_attributesDPatchTest.test_patchobject_with_create_mocks_non_existent_attributesk  sD    	iH,<,<T	J	B 
K	B 	i3r"   c                
   V P                  \        4      ;_uu_ 4        \        R \        ,          \        P
                  4      R 4       pV! 4        RRR4       V P                  \        R 4       R#   + '       g   i     L); i)r:  c                      R # r   r#   r#   r"   r   r   9PatchTest.test_patch_wont_create_by_default.<locals>.testv      r"   Nc                      \         # r   rB  r#   r"   r   r   =PatchTest.test_patch_wont_create_by_default.<locals>.<lambda>z  rD  r"   )rs   r   r   r   r   r?  rE  r   s   & r   !test_patch_wont_create_by_default+PatchTest.test_patch_wont_create_by_defaultt  sY    ~..<.0(2B2BC DF	 /
 	)_5 /.s   3A22B	c                   V P                  \        4      ;_uu_ 4        \        P                  ! \        R \
        P                  4      R 4       pV! 4        RRR4       V P                  \        R 4       R#   + '       g   i     L(; i)ordc                      R # r   r#   r#   r"   r   r   ?PatchTest.test_patchobject_wont_create_by_default.<locals>.test  rQ  r"   N)rs   r   r   r5   r   r   r?  rK  r   s   & r   'test_patchobject_wont_create_by_default1PatchTest.test_patchobject_wont_create_by_default}  sY    ~..\\)UH,<,<= >F / 	i/	 /.s   8A66B	c                    \        \        R ,           4      R 4       p\        \        R,           4      R 4       pV P                  V! 4       ^e4       V P                  V! 4       R4       R# )z.ordc                 &    ^eV n         \        R4      # )e   c)r   rW  )mock_ords   &r   test_ord>PatchTest.test_patch_builtins_without_create.<locals>.test_ord  s    $'H!s8Or"   z.openc                     V P                   pR VP                  n         \        R4      pVP                  4       pVP                  4        V# )abcdzdoesnotexists.txt)r   readr   close)	mock_openmfobjdatas   &   r   	test_open?PatchTest.test_patch_builtins_without_create.<locals>.test_open  s=    &&A"(AFF+,D99;DJJLKr"   rd  Nr   r$   r   )r   ra  rk  s   &  r   "test_patch_builtins_without_create,PatchTest.test_patch_builtins_without_create  sa    	x		 
 	 
x	 	 
!	 	S)f-r"   c                   a a  ! R  R\         4      o\        P                   ! SR\        R 4      4      VV 3R l4       pV! 4        S P                  SP	                  4       \
        P                  4       R# )c                   0   a  ] tR tRt o ]R 4       tRtV tR# )5PatchTest.test_patch_with_static_methods.<locals>.Fooi  c                 "    \         P                  # r   )r   Staticr#   r"   r   woot:PatchTest.test_patch_with_static_methods.<locals>.Foo.woot  s    &r"   r#   N)r$   r%   r&   r'   rV   ru  r(   r)   rS   s   @r   r9   rr    s     ' 'r"   r9   ru  c                  "    \         P                  # r   )r   r   r#   r"   r   r   :PatchTest.test_patch_with_static_methods.<locals>.<lambda>  s
    8H8Hr"   c                  d   < SP                  S P                  4       \        P                  4       R # r   )r   ru  r   r   )r9   r   s   r   	anonymous;PatchTest.test_patch_with_static_methods.<locals>.anonymous  s    SXXZ)9)9:r"   N)r5   r   rV   r   ru  r   rt  )r   rz  r9   s   f @r   test_patch_with_static_methods(PatchTest.test_patch_with_static_methods  sV    	'& 	'
 
c6<0H#I	J	; 
K	;X__5r"   c                   a  \         P                  p\        P                  ! \         R R 4      V 3R l4       pV! 4        S P	                  \         P                  V4       R# )r9   c                  H   < S P                  \        P                  R 4       R# r9   N)r   r   r9   rC   s   r   rz  -PatchTest.test_patch_local.<locals>.anonymous  s    X\\51r"   N)r   r9   r   r5   r   )r   rU   rz  s   f  r   test_patch_localPatchTest.test_patch_local  sD    ll	hu	-	2 
.	2s+r"   c                  a a  ! R  R\         4      pV! 4       o\        P                  Sn        \        P                   ! SRR4      VV 3R l4       pV! 4        S P	                  SP                  \        P                  4       R# )c                       ] tR tRtRtRtR# )'PatchTest.test_patch_slots.<locals>.Fooi  r#   N)r9   )r$   r%   r&   r'   	__slots__r(   r#   r"   r   r9   r    s     Ir"   r9   c                  @   < SP                  S P                  R 4       R# r  )r   r9   rU   r   s   r   rz  -PatchTest.test_patch_slots.<locals>.anonymous  s    SWWe,r"   N)r5   r   r9   r   r   )r   r9   rz  rU   s   f  @r   test_patch_slotsPatchTest.test_patch_slots  s_    	!& 	! e,,	c5%	(	- 
)	-(,,/r"   c                J  a a  ! R  R\         4      o ! VV 3R lR\         4      p\        P                   ! SR\        P                  4      ! V4      pV! 4       pVP	                  4        VP                  4        S P                  SP                  \        P                  R4       R# )c                   .    ] tR tRt]P
                  tRtR# )=PatchTest.test_patchobject_class_decorator.<locals>.Somethingi  r#   Nr~   r#   r"   r   r   r    r   r"   r   c                   >   <a  ] tR tRt o VV3R ltVV3R ltRtV tR# )7PatchTest.test_patchobject_class_decorator.<locals>.Fooi  c                ^   < SP                  SP                  \        P                  R 4       R# r   r   
other_selfr   r   s   &r   test_methodCPatchTest.test_patchobject_class_decorator.<locals>.Foo.test_method  s$      !4!4h6F6F!,.r"   c                ^   < SP                  SP                  \        P                  R 4       R# znon-test method patchedN)r   r   r   r   r  s   &r   not_test_methodGPatchTest.test_patchobject_class_decorator.<locals>.Foo.not_test_method  s$      !4!4h6G6G!:<r"   r#   N)r$   r%   r&   r'   r  r  r(   r)   )r*   r   r   s   @r   r9   r    s     .< <r"   r9   r   r   N)	r5   r   r   r   r  r  r   r   r   )r   r9   r@   r   s   f  @r    test_patchobject_class_decorator*PatchTest.test_patchobject_class_decorator  s|    	* 	*	< 	<& 	< ll9k83C3CDSIE		,,h.?.?-	/r"   c                  a   ! R  R\         4      p ! V 3R lR\         4      p\        R\        ,          4      ! V4      pV! 4       pVP                  4        VP	                  4        S P                  VP                  \        P                  R4       S P                  \        P                  \        P                  R4       R# )c                   .    ] tR tRt]P
                  tRtR# )7PatchTest.test_patch_class_decorator.<locals>.Somethingi  r#   Nr~   r#   r"   r   r   r    r   r"   r   c                   >   <a  ] tR tRt o RtV3R ltV3R ltRtV tR# )1PatchTest.test_patch_class_decorator.<locals>.Fooi  whateverc                J   < SP                  \        P                  VR 4       R# r   )r   r   r   )r  mock_somethingr   s   &&r   r  =PatchTest.test_patch_class_decorator.<locals>.Foo.test_method  s      !3!3^!,.r"   c                f   < SP                  \        P                  \        P                  R 4       R# r  )r   r   r   r   r   )r  r   s   &r   r  APatchTest.test_patch_class_decorator.<locals>.Foo.not_test_method  s$      !3!3X5G5G!:<r"   r#   N)	r$   r%   r&   r'   test_class_attrr  r  r(   r)   )r*   r   s   @r   r9   r    s     (O.< <r"   r9   r   r   N)r5   r   r$   r  r  r   r   r   r   r   r   r   )r   r   r9   r@   s   f   r   test_patch_class_decorator$PatchTest.test_patch_class_decorator  s    	* 	*		<& 		< NX-.s3E		,,h.?.?-	/++X-?-?-	/r"   c                >  a a  ! R  R\         4      o\        P                   ! SR\        P                  4      \        P                   ! SR\        P                  4      VV 3R l4       4       pV! 4        S P	                  SP
                  \        P                  R4       R# )c                   F    ] tR tRt]P
                  t]P                  tRt	R# )3PatchTest.test_patchobject_twice.<locals>.Somethingi  r#   Nr   r#   r"   r   r   r    r   r"   r   r   c                  ^   < SP                  S P                  \        P                  R 4       R# r   r   r   s   r   r   .PatchTest.test_patchobject_twice.<locals>.test  s#     Y00(2B2BKPr"   r   Nr   r   s   f @r   test_patchobject_twice PatchTest.test_patchobject_twice  s}    	0 	0 
ih.>.>	?	ih.>.>	?	Q 
@ 
@	Q 	,,h.?.?-	/r"   c                  a a R \        4       RR/oSP                  4       p\        P                  ! S4      V3R l4       pV! 4        S P	                  SV4       \        P                  ! SRR/4      VV 3R l4       pV! 4        S P	                  SV4       \        P                  ! SR	.4      VV 3R l4       pV! 4        S P	                  SV4       R# )
initialotherr   c                  "   < ^S R&   S R RS R&   R#    r<   r  something elser  Nr#   rU   s   r   r   'PatchTest.test_patch_dict.<locals>.test      CHI+CLr"   r<   rZ   c                  p   < SP                  \        S 4      ^4       SP                  S R,          R4       R# r  r<   rZ   Nr   lenr  s   r   r   r    +    SXq)SXs+r"   c                  p   < SP                  \        S 4      ^4       SP                  S R,          R4       R# r  r  r  s   r   r   r    r  r"   NrY   r5   copyr   dictr   r   r   r   rU   s   f  @r   test_patch_dictPatchTest.test_patch_dict   s    &(G[988:	C	, 
	,
 	h'	C#s	$	, 
%	, 	h'	C*	&	, 
'	, 	h'r"   c                  a a \        4       o\        4       SR &   RSR&   SP                  P                  4       p\        P
                  ! S4      V3R l4       pV! 4        S P                  SP                  V4       \        P
                  ! SRR/4      VV 3R l4       pV! 4        S P                  SP                  V4       R# )r  r   r  c                  "   < ^S R&   S R RS R&   R# r  r#   r  s   r   r   =PatchTest.test_patch_dict_with_container_object.<locals>.test(  r  r"   r<   rZ   c                     < SP                  \        S P                  4      ^4       SP                  S R,          R4       R# r  )r   r  r`   r  s   r   r   r  2  s/    S_a0SXs+r"   Nr]   r5   r`   r  r   r  r   r  s   f  @r   %test_patch_dict_with_container_object/PatchTest.test_patch_dict_with_container_object!  s    kI#G::??$	C	, 
	,
 	X.	C#s	$	, 
%	, 	X.r"   c                  a a R \        4       RR/oSP                  4       p\        P                  ! SRR7      VV 3R l4       pV! 4        S P	                  SV4       \        P                  ! SRR/RR7      VV 3R l4       pV! 4        S P	                  SV4       \        P                  ! SR.RR7      VV 3R	 l4       pV! 4        S P	                  SV4       R
# )r  r  r   Tclearc                  @   < SP                  S / 4       ^S R&   RS R&   R# r  r<   r  r  Nr   r  s   r   r   2PatchTest.test_patch_dict_with_clear.<locals>.test@  s%    S"%CH+CLr"   r<   rZ   c                  0   < SP                  S R R/4       R# r<   rZ   Nr  r  s   r   r   r  J      S3*-r"   c                  0   < SP                  S R R/4       R# r  r  r  s   r   r   r  R  r  r"   NrY   r  r  s   f  @r   test_patch_dict_with_clear$PatchTest.test_patch_dict_with_clear<  s    &(G[988:	Ct	$	, 
%	,
 	h'	C#s4	0	. 
1	. 	h'	C*T	2	. 
3	. 	h'r"   c                  a a \        4       o\        4       SR &   RSR&   SP                  P                  4       p\        P
                  ! SRR7      VV 3R l4       pV! 4        S P                  SP                  V4       \        P
                  ! SRR/RR7      VV 3R l4       pV! 4        S P                  SP                  V4       R	# )
r  r   r  Tr  c                  T   < SP                  S P                  / 4       ^S R&   RS R&   R# r  r   r`   r  s   r   r   GPatchTest.test_patch_dict_with_container_object_and_clear.<locals>.testb  s)    SZZ,CH+CLr"   r<   rZ   c                  D   < SP                  S P                  R R/4       R# r  r  r  s   r   r   r  l  s    SZZ#s4r"   Nr  r  s   f  @r   /test_patch_dict_with_container_object_and_clear9PatchTest.test_patch_dict_with_container_object_and_clear[  s    kI#G::??$	Ct	$	, 
%	,
 	X.	C#s4	0	5 
1	5 	X.r"   c                    R R/p\         P                  ! VRR7      ;_uu_ 4       pV P                  VR R/4       RRR4       V P                  VR R/4       R#   + '       g   i     L&; i)r<   rZ   r_  )r<   N)r   r  r   )r   rU   patcheds   &  r   "test_patch_dict_as_context_manager,PatchTest.test_patch_dict_as_context_manageru  sT    CjZZs##wWsCj1 $sCj) $#s   AA(	c                R   / p\        R \        ,          \        4       4      \        R \        ,          \        4       RR7      \         P                  ! \        \        4       4      \         P                  ! V4      R 4       4       4       4       pV P                  VP                  R4       R# )r   Tautospecc                      R # r   r#   r#   r"   r   	some_name0PatchTest.test_name_preserved.<locals>.some_name  s     r"   r  N)r   r$   r5   r   r  r   )r   rU   r  s   &  r   test_name_preservedPatchTest.test_name_preserved|  sy    	~(&(	3	~(&(T	B	i	*	C 
 
+ 
C 
4 	++[9r"   c                    / p\         P                  ! VR R/4      R 4       pV P                  \        4      ;_uu_ 4        V! 4        RRR4       V P	                  V/ 4       R#   + '       g   i     L$; i)r<   rZ   c                      \        R 4      h)KonradrE  r#   r"   r   r   1PatchTest.test_patch_with_exception.<locals>.test  s    H%%r"   N)r   r  rs   rE  r   )r   rU   r   s   &  r   test_patch_with_exception#PatchTest.test_patch_with_exception  s`    	C#s	$	& 
%	& y))F * 	b! *)s   A##A3	c                Z   a  \         P                  ! R RR/4      V 3R l4       pV! 4        R# )z
os.environkonrad_delongz
some valuec                  H   < S P                  R \        P                  4       R# )r  N)assertInosenvironrC   s   r   r   3PatchTest.test_patch_dict_with_string.<locals>.test  s    MM/2::6r"   N)r   r  r   s   f r   test_patch_dict_with_string%PatchTest.test_patch_dict_with_string  s-    	L?L"A	B	7 
C	7 	r"   c                ,  a  \         P                  P                  4       p\        P                  ! R RR/4      V 3R l4       p RR/\         n        V! 4        S P                  \         P                  RR/4       V\         n        R#   T\         n        i ; i)z*test.test_unittest.testmock.support.targetrF   BARc                  P   < S P                  \        P                  R RRR/4       R# )rU   BAZrF   r   N)r   r   targetrC   s   r   r   <PatchTest.test_patch_dict_decorator_resolution.<locals>.test  s     W^^eUE5-IJr"   rU   r  N)r   r  r  r   r  r   r   s   f  r   $test_patch_dict_decorator_resolution.PatchTest.test_patch_dict_decorator_resolution  sx     >>&&(	@5%.	Q	K 
R	K	&#U^GNFW^^eU^<%GNXGNs   6B Bc                   \        R \        ,          \        RR7      R 4       pV P                  \        V4       \         P
                  ! \        R\        RR7      R 4       pV P                  \        V4       \        R \        ,          RR7      R 4       pV P                  \        V4       \         P
                  ! \        RRR7      R 4       pV P                  \        V4       R	# )
r   Tr   spec_setc                     R V n         R# rU   Nzrx   s   &r   r   +PatchTest.test_patch_spec_set.<locals>.test  	    IKr"   r   c                     R V n         R# r  r  r  s   &r   r   r    r  r"   r	  c                     R V n         R# r  r  r  s   &r   r   r    r  r"   c                     R V n         R# r  r  r  s   &r   r   r    r  r"   N)r   r$   r   rs   r   r5   r   r   s   & r   test_patch_spec_setPatchTest.test_patch_spec_set  s    	~(y4	H	  
I	  	.$/	g{T	J	  
K	  	.$/	~(4	8	  
9	  	.$/	g{T	:	  
;	  	.$/r"   c                n    \        R \        ,          RR7      R 4       pV P                  \        V4       R# )r   Tr  c                 "    V ! 4       pR Vn         R# r  r  )rx   r4  s   & r   r   -PatchTest.test_spec_set_inherit.<locals>.test  s     {HHJr"   N)r   r$   rs   r   r   s   & r   test_spec_set_inheritPatchTest.test_spec_set_inherit  s2    	~(4	8	 
9	 	.$/r"   c                P   \         p\        R \        ,          4      pV P                  \         V4       VP	                  4       p V P                  W14       V P                  \         V4       VP                  4        V P                  \         V4       R#   TP                  4        i ; i)r   N)r   r   r$   assertIsstartassertIsNotstop)r   r   patcherr   s   &   r   test_patch_start_stopPatchTest.test_patch_start_stop  st    12i*}}	T,MM)T*LLNi* LLNs   'B B%c                f    \        \        R ^4      pV P                  VP                  4       4       R# rF   N)r   foo_namer   r   r   r!  s   & r   test_stop_without_start!PatchTest.test_stop_without_start  s$    %+',,.)r"   c                    \        \        R ^4      pVP                  4        VP                  4        V P	                  VP                  4       4       R# r%  )r   r&  r  r   r   r'  s   & r   test_stop_idempotentPatchTest.test_stop_idempotent  s6    %+',,.)r"   c                    \        \        R ^4      pV;_uu_ 4        VP                  RRR4       RRR4       R#   + '       g   i     R# ; ir%  )r   r&  __exit__r'  s   & r   test_exit_idempotentPatchTest.test_exit_idempotent  s3    %+WT4. WWWs	   :A	c                    \        \        R ^4      pVP                  4         V P                  \        VP                  4       VP                  4        R#   TP                  4        i ; ir%  )r   r&  r  rs   RuntimeErrorr   r'  s   & r   test_second_start_failure#PatchTest.test_second_start_failure  sE    %+	lGMM:LLNGLLNs    A A'c                    \        \        R ^4      pV;_uu_ 4        V P                  \        VP                  4       RRR4       R#   + '       g   i     R# ; ir%  )r   r&  rs   r2  r  r'  s   & r   test_second_enter_failure#PatchTest.test_second_enter_failure  s5    %+WlGMM: WWWs   !AA	c                    \        \        R ^4      pVP                  4        VP                  4        VP                  4        VP                  4        R# r%  )r   r&  r  r   r'  s   & r   test_second_start_after_stop&PatchTest.test_second_start_after_stop  s4    %+r"   c                   \        4       pVP                  p\        P                  ! VR R4      pV;_uu_ 4        V P	                  VP
                  R4       V P                  VP                  V4       V P	                  VP                  V4       RVn        W#n        Wn        V P	                  VP
                  R4       V P                  VP                  V4       V P	                  VP                  V4       RRR4       V P	                  VP                  V4       V P	                  VP                  R4       R#   + '       g   i     LJ; i)rF   xFTN)	r   rF   r   r5   r   is_localr  r  temp_original)r   mock_objectmock_barr!  s   &   r   test_property_settersPatchTest.test_property_setters	  s    f??,,{E37WW--u5MM'..+6W22H=#G%N$/!W--t4MM'..(3W22K@  	{3#. Ws   B<D77E	c                ^   \         p\        P                  ! \        R R4      pV P	                  \         V4       VP                  4       p V P                  VR4       V P	                  \         V4       VP                  4        V P	                  \         V4       R#   TP                  4        i ; i)r   rU   N)r   r   r5   r   r  r  r   r   )r   r   r!  replaceds   &   r   test_patchobject_start_stop%PatchTest.test_patchobject_start_stop  sy    ,,xe<i*==?	Xu-MM)X.LLNi* LLNs   
(B B,c                :   R R/pVP                  4       p\        P                  ! VR.RR7      pV P                  W4       VP	                  4         V P                  VRR/4       VP                  4        V P                  W4       R#   TP                  4        i ; i)rU   rF   spameggsTr  NrH  rI  )r  r   r  r   r  r   r   dr   r!  s   &   r   test_patch_dict_start_stop$PatchTest.test_patch_dict_start_stop)  s    EN668**Q!1 2$?%	Q 01LLN% LLNs   B Bc                    R R/pVP                  4       p\        P                  ! VR.RR7      pV P                  VP	                  4       4       V P                  W4       R# )rU   rF   Tr  NrJ  )r  r   r  rv   r   r   rK  s   &   r   "test_patch_dict_stop_without_start,PatchTest.test_patch_dict_stop_without_start7  sN    EN668**Q!1 2$?(%r"   c                  aa V oR R/oSP                  4       p ! VV3R lR\        4      p\        P                  ! SRR/RR7      ! V4      pV P	                  SV4       V! 4       pVP
                  ! 4        V P	                  SV4       VP                  ! 4        V P	                  SV4       V! 4       pVP
                  ! 4        V P	                  SV4       VP                  ! 4        V P	                  SV4       R# )	rH  rI  c                   >   <a  ] tR tRt o VV3R ltVV3R ltRtV tR# )7PatchTest.test_patch_dict_class_decorator.<locals>.TestiD  c                0   < SP                  SR R/4       R# rU   rF   Nr  r   rL  thiss   &r   
test_firstBPatchTest.test_patch_dict_class_decorator.<locals>.Test.test_firstE        UEN3r"   c                0   < SP                  SR R/4       R# rV  r  rW  s   &r   test_secondCPatchTest.test_patch_dict_class_decorator.<locals>.Test.test_secondG  r[  r"   r#   N)r$   r%   r&   r'   rY  r]  r(   r)   )r*   rL  rX  s   @r   r   rT  D  s     44 4r"   r   rU   rF   Tr  N)r  r5   r   r  r   rY  r]  )r   r   r   r   rL  rX  s   &   @@r   test_patch_dict_class_decorator)PatchTest.test_patch_dict_class_decorator?  s    V668	4 	46 	4 zz!eU^48>H%vH%H%vH%H%r"   c                n  a a  ! R  R\         4      p ! R R4      pWV! 4       V3 F  p\        V4      o\        P                   ! SRR4      VV 3R l4       pV! 4        S P                  SP                  R4       S P                  VP                  R4       S P                  RSP                  4       K  	  R# )c                       ] tR tRtRtRtR# )0PatchTest.test_get_only_proxy.<locals>.Somethingi_  rU   r#   Nr$   r%   r&   r'   rU   r(   r#   r"   r   r   rc  _      Cr"   r   c                       ] tR tRtRtRtR# )4PatchTest.test_get_only_proxy.<locals>.SomethingElseia  rU   r#   Nrd  r#   r"   r   r   rg  a  re  r"   r   rU   rF   c                  @   < SP                  S P                  R 4       R# r%  r   rU   proxyr   s   r   r   +PatchTest.test_get_only_proxy.<locals>.testg        E2r"   Nr5   r7   r   r   rU   assertNotIn__dict__r   r   r   thingr   rk  s   f    @r   test_get_only_proxyPatchTest.test_get_only_proxy^  s    	 		 	 y{MIEu%E\\%.3 /3FUYY.UYY.UENN3 Jr"   c                r  a a  ! R  R\         4      p ! R R4      pWV! 4       V3 F  p\        VRR7      o\        P                   ! SRR4      VV 3R l4       pV! 4        S P                  SP                  R4       S P                  VP                  R4       S P                  RSP                  4       K  	  R	# )
c                       ] tR tRtRtRtR# )6PatchTest.test_get_set_delete_proxy.<locals>.Somethingiq  rU   r#   Nrd  r#   r"   r   r   rw  q  re  r"   r   c                       ] tR tRtRtRtR# ):PatchTest.test_get_set_delete_proxy.<locals>.SomethingElseis  rU   r#   Nrd  r#   r"   r   r   ry  s  re  r"   r   F)r6   rU   rF   c                  @   < SP                  S P                  R 4       R# r%  ri  rj  s   r   r   1PatchTest.test_get_set_delete_proxy.<locals>.testy  rm  r"   Nrn  rq  s   f    @r   test_get_set_delete_proxy#PatchTest.test_get_set_delete_proxyp  s    	 		 	 y{MIEy59E\\%.3 /3FUYY.UYY.UENN3 Jr"   c                N   R \         R^!R\        4       /p\        \        3/ VB pVP	                  4       pVP                  4        V P                  \         V4       V P                  VP                  P                  4       ^!4       V P                  VP                  \        4       R# )side_effectfoo.bar.return_valuerU   N)KeyErrorr   r   r&  r  r   rs   r   rU   rF   r   r   kwargsr!  r   s   &   r   test_patch_keyword_args!PatchTest.test_patch_keyword_args  s}    +A2& +F+}}(D),dhh	2r"   c                f   R \         R^!R\        4       /p\        P                  ! \        R3/ VB pVP                  4       pVP                  4        V P                  \         V4       V P                  VP                  P                  4       ^!4       V P                  VP                  \        4       R# )r  r  rU   r@   N)r  r   r   r5   r9   r  r   rs   r   rU   rF   r   r  s   &   r   test_patch_object_keyword_args(PatchTest.test_patch_object_keyword_args  s    +A2& ,,sC262}}(D),dhh	2r"   c           	     ,   R R/pVP                  4       p\        P                  ! V^^^R7      pVP                  4         V P	                  V\        ^^^R7      4       VP                  4        V P	                  W4       R#   TP                  4        i ; i)rU   rF   )rU   rF   bazN)r  r   r  r  r   r   )r   r   r  r!  s   &   r   test_patch_dict_keyword_args&PatchTest.test_patch_dict_keyword_args  su    5>}}**X1!;	Xtqa'@ALLN( LLNs    B Bc                  a aa  ! R  R\         4      pV 3R loV 3R loVVV 3R lp\        \        RR7      ! V4      pV! 4       pS P                  \        V4       V! 4        \
        P                  \        ,          p\        P                   ! VRRR7      ! V4      pV! 4       pS P                  \        V4       V! 4        R# )	c                   L   a  ] tR tRt o R tR tR tRt ! R R]4      t	Rt
V tR	# )
$PatchTest.test_autospec.<locals>.Booi  c                    R # r   r#   r;   s   &&r   r=   -PatchTest.test_autospec.<locals>.Boo.__init__  s    4r"   c                    R # r   r#   r;   s   &&r   r@   &PatchTest.test_autospec.<locals>.Boo.f  s    Dr"   c                    R # r   r#   rC   s   &r   rD   &PatchTest.test_autospec.<locals>.Boo.g  s    r"   rF   c                   &   a  ] tR tRt o R tRtV tR# )(PatchTest.test_autospec.<locals>.Boo.Bari  c                    R # r   r#   rC   s   &r   r<   *PatchTest.test_autospec.<locals>.Boo.Bar.a  s    Tr"   r#   NrR   rS   s   @r   rT   r    s     !!r"   rT   r#   N)r$   r%   r&   r'   r=   r@   rD   rU   r5   rT   r(   r)   rS   s   @r   Boor    s$     ' C"f " "r"   r  c                 f   < V ! ^4       V P                  ^4       SP                  \        V 4       R#    N)assert_called_withrs   rt   r   r   s   &r   _test&PatchTest.test_autospec.<locals>._test  s(    G##A&i.r"   c                   < V P                  ^4       V P                   P                  ^4       SP                  \        V P                   4       V P	                  4        V P                  P                  4        SP                  \        V P                  ^4       SP                  \
        \        V R4       V P                  P                  4        V P                  P                  P                  4        SP                  \
        \        V P                  R4       V P                  4        V P                  P                  4        V P                  P                  4        V P                  P                  P                  4        SP                  \        V P                  P                  ^4       V P                  4       P                  4        V P                  4       P                  P                  4        SP                  \        V P                  4       P                  ^4       SP                  \
        \        V P                  R4       SP                  \
        \        V P                  4       R4       R# )r  hrF   rZ   N)r@   r  rs   rt   rD   r   r   rU   lowerrT   r<   r  s   &r   _test2'PatchTest.test_autospec.<locals>._test2  sx   FF1IFF%%a(i0FFHFF%%'i3ngtSAHHNNHHNN--/ngtxxGHHJHH'')HHJJLHHJJ))+iQ7HHJLLNHHJLL++-iq9ngtxxEngtxxz3Gr"   c                 p   < S! V 4       S! V 4       S! V ! ^4      4       SP                  V \        4       V # r  )r  r9   )r   r  r  r   s   &r   r[   )PatchTest.test_autospec.<locals>.function  s/    $K4L47OMM$$Kr"   Tr  r9   N)r5   r   r&  r  r9   sysmodulesr$   )r   r  r[   r   r   moduler  r  s   f     @@r   test_autospecPatchTest.test_autospec  s    	"& 	"	/
	H:	 X-h7vd#X&||FED9(Cvd#r"   c                X   a  \        R \        ,          RR7      V 3R l4       pV! 4        R# )%s.functionTr  c                 P  < \         P                  4        SP                  \        \         P                  4       SP                  \        \         P
                  4       \        ^4       SP                  \        \         P                  4       \         P                  ^4       \         P	                  4        \         P                  4        \        ^^4       \         P                  ^^4       SP                  \        \         4       SP                  \        \        \         R4       R# )r  rU   N)
r[   assert_not_calledrs   AssertionErrorassert_calledassert_called_oncer  rt   r   r   r  s   &r   r   .PatchTest.test_autospec_function.<locals>.test  s    &&(nh.D.DEnh.I.IJQKnh.H.HI''*""$'')QN''1-i2ngxGr"   Nr  r   s   f r   test_autospec_function PatchTest.test_autospec_function  s*    	}x'$	7	H 
8	H 	r"   c                v    \        R \        ,          R^R7      R 4       pV! 4       pV P                  V^4       R# )r  T)r  r   c                     \        ^^4      # r  )r[   )mock_functions   &r   r   .PatchTest.test_autospec_keywords.<locals>.test  s     Aq>!r"   Nrm  )r   r   results   &  r   test_autospec_keywords PatchTest.test_autospec_keywords  s>    	}x'$
	"
	" #r"   c                    \        R \        ,          RR7      ;_uu_ 4       p\        P                  4        VP	                  4        RRR4       R#   + '       g   i     R# ; i)z%s.Foo.static_methodTr  N)r   r$   r9   rH   assert_called_once_withr   methods   & r   test_autospec_staticmethod$PatchTest.test_autospec_staticmethod  s?    )H4tDD**, EDDD   %AA!	c                    \        R \        ,          RR7      ;_uu_ 4       p\        P                  4        VP	                  4        RRR4       R#   + '       g   i     R# ; i)z%s.Foo.class_methodTr  N)r   r$   r9   rL   r  r  s   & r   test_autospec_classmethod#PatchTest.test_autospec_classmethod  s?    (83dCCv**, DCCCr  c                d    ! R  R4      pVP                  ^^^R7       \        P                  ! VRRR7      ;_uu_ 4       pV! ^^^R7       V P                  \        V4       V P                  \        V^4       V P                  \        V^^^^R7       RRR4       R#   + '       g   i     R# ; i)c                   4   a  ] tR tRt o ]RR l4       tRtV tR# );PatchTest.test_autospec_staticmethod_signature.<locals>.Fooi  c                   R # r   r#   )r<   rZ   r_  s   &&$r   rH   IPatchTest.test_autospec_staticmethod_signature.<locals>.Foo.static_method  s    .2r"   r#   N
   )r$   r%   r&   r'   rV   rH   r(   r)   rS   s   @r   r9   r    s     2 2r"   r9   r_  rH   Tr  N)rH   r   r5   rs   rt   r   r9   r  s   &  r   $test_autospec_staticmethod_signature.PatchTest.test_autospec_staticmethod_signature  s    	3 	3 	!Q!$\\#>>&1a1i0i3iAqA>	 ?>>>    ABB/	c                d    ! R  R4      pVP                  ^^^R7       \        P                  ! VRRR7      ;_uu_ 4       pV! ^^^R7       V P                  \        V4       V P                  \        V^4       V P                  \        V^^^^R7       RRR4       R#   + '       g   i     R# ; i)c                   4   a  ] tR tRt o ]RR l4       tRtV tR# ):PatchTest.test_autospec_classmethod_signature.<locals>.Fooi*  c                   R # r   r#   )rK   r<   rZ   r_  s   &&&$r   rL   GPatchTest.test_autospec_classmethod_signature.<locals>.Foo.class_method+  s    26r"   r#   Nr  )r$   r%   r&   r'   rW   rL   r(   r)   rS   s   @r   r9   r  *  s     6 6r"   r9   r  rL   Tr  N)rL   r   r5   rs   rt   r  s   &  r   #test_autospec_classmethod_signature-PatchTest.test_autospec_classmethod_signature(  s    	7 	7 	A#\\#~==1a1i0i3iAqA>	 >===r  c                "   \        R \        ,          ^RR7      pV P                  \        VP                  4       \
        P                  \        ,          p\         P                  ! VR^RR7      pV P                  \        VP                  4       R# )r  T)newr  r[   N)r   r$   rs   rt   r  r  r  r5   )r   r!  r  s   &  r   test_autospec_with_new PatchTest.test_autospec_with_new7  s_    0a$G)W]]3X&,,vzq4H)W]]3r"   c                    ! R  R\         4      p\        \        VR7      pVP                  4       p V P	                  W14       V P	                  VP
                  \        4       VP                  4        R#   TP                  4        i ; i)c                       ] tR tRt. tRtR# )0PatchTest.test_autospec_with_object.<locals>.BariA  r#   N)r$   r%   r&   r'   extrar(   r#   r"   r   rT   r  A  s    Er"   rT   r  N)r9   r   r&  r  r   r  listr   )r   rT   r!  r   s   &   r   test_autospec_with_object#PatchTest.test_autospec_with_object@  sa    	# 	 3/}}	!!$,!!$**d3LLNGLLNs   1A5 5Bc                    \         p\        \        R R7      pVP                  4       p V P	                  W14       V P	                  V! ^4      V4       VP                  4        R#   TP                  4        i ; i)Tr  N)r9   r   r&  r  r   r   )r   FooClassr!  r   s   &   r   test_autospec_inherits PatchTest.test_autospec_inheritsM  sX    40}}	!!$1!!$q'84LLNGLLNs   )A$ $A6c                   \        \        R R7      pVP                  4       p V P                  R\	        V4      4       V P                  R\	        VP
                  4      4       V P                  R\	        V! R4      4      4       V P                  R\	        V! R4      P
                  4      4       VP                  4        R#   TP                  4        i ; i)Tr  z name='Foo'z name='Foo.f'z name='Foo()'Nz name='Foo().f')r   r&  r  r  reprr@   r   )r   r!  r   s   &  r   test_autospec_namePatchTest.test_autospec_nameX  s    40}}	MM-d4MM/4<8MM/4T
+;<MM+T$t*,,-?@LLNGLLNs   BC Cc                   \         P                  ! \        R \        4       4      R 4       p V! 4        \
        P                  ! RR^ 4      pTP                  XT 4      pT P                  RT4       R#    \        P                  ! 4       p LW; i)r@   c                      \         hr   )r  r#   r"   r   r   'PatchTest.test_tracebacks.<locals>.testf  s      r"   Nzraise AssertionError)	r   r5   r9   r  exc_infounittestTextTestResult_exc_info_to_stringr  )r   r   errr  	tracebacks   &    r   test_tracebacksPatchTest.test_tracebackse  sv    	c3	)	! 
*	!	!F ((tQ7..sD9	,i8	!,,.Cs   A1 1B
c                   \        \        \        R 7      pVP                  4       pVP	                  4        VP                  4       pVP	                  4        V P                  W#4       W#3 F  pV P                  V4       K  	  R# )new_callableN)r   r&  r   r  r   r  ry   r   r!  m1m2r   s   &    r   test_new_callable_patch!PatchTest.test_new_callable_patchs  s_    /CD]]_]]_ FD""4( r"   c                    \         P                  ! \        R \        R7      pVP	                  4       pVP                  4        VP	                  4       pVP                  4        V P                  W#4       W#3 F  pV P                  V4       K  	  R# )r@   r  N)r   r5   r9   r   r  r   r  ry   r  s   &    r   test_new_callable_patch_object(PatchTest.test_new_callable_patch_object  se    ,,sC6JK]]_]]_ FD""4( r"   c                B  a  ! V3R  lR\         4      o\        \        S^^R7      pVP                  4       p V P	                  \        V4      S4       V P                  SP                  \        ^^R7      4       VP                  4        R#   TP                  4        i ; i)c                   2   <a  ] tR tRt o RtV3R ltRtV tR# ):PatchTest.test_new_callable_keyword_arguments.<locals>.Bari  Nc                   < VSn         R # r   r  r   r  rT   s   &,r   r=   CPatchTest.test_new_callable_keyword_arguments.<locals>.Bar.__init__  
    #
r"   r#   r$   r%   r&   r'   r  r=   r(   r)   r*   rT   s   @r   rT   r         F$ $r"   rT   )r  arg1arg2)r  r  N)
r5   r   r&  r  r  typer   r  r  r   )r   r!  rh  rT   s   &  @r   #test_new_callable_keyword_arguments-PatchTest.test_new_callable_keyword_arguments  sq    	$& 	$
 sCMMO	MM$q'3'SZZ11)=>LLNGLLNs   AB Bc                  a  ! V3R  lR\         4      o\        \        SSR7      pVP                  4         V P	                  SP
                  \        SR7      4       VP                  4        \        \        SSR7      pVP                  4         V P	                  SP
                  \        SR7      4       VP                  4        R#   TP                  4        i ; i  TP                  4        i ; i)c                   2   <a  ] tR tRt o RtV3R ltRtV tR# )-PatchTest.test_new_callable_spec.<locals>.Bari  Nc                   < VSn         R # r   r
  r  s   &,r   r=   6PatchTest.test_new_callable_spec.<locals>.Bar.__init__  r  r"   r#   r  r  s   @r   rT   r    r  r"   rT   r  r   r   )r  r	  r  N)r5   r   r&  r  r   r  r  r   )r   r!  rT   s   & @r   test_new_callable_spec PatchTest.test_new_callable_spec  s    	$& 	$
 s=	SZZ38LLNsSA	SZZs);<LLN LLN LLNs   &C &C CC/c                8   R \         ,          p\        V\        R7      pV P                  \        VP
                  4       \        V\        RR7      pVP                  4       p V P                  VRR7       VP                  4        R#   TP                  4        i ; i)z	%s.weeeeer  T)r  r<  F)rw   N)r&  r   r	   rs   r   r  ry   r   )r   non_existent_attrprh  s   &   r   test_new_callable_create"PatchTest.test_new_callable_create  sv    '(2#/B.!''2#/GGI	""1E"2FFHAFFHs   "B Bc           	         V P                  \        \        \        \	        4       \
        R 7       V P                  \        \        P                  \        R\	        4       \
        R 7       R# ))r  r  r@   N)rs   
ValueErrorr   r&  r5   r   r9   rC   s   &r   'test_new_callable_incompatible_with_new1PatchTest.test_new_callable_incompatible_with_new  sK    xVXI 	 	
 	c3FH" 	 	
r"   c           	         V P                  \        \        \        \        R R7       V P                  \        \        P
                  \        R\        R R7       R# )T)r  r  r@   N)rs   r$  r   r&  r   r5   r9   rC   s   &r   ,test_new_callable_incompatible_with_autospec6PatchTest.test_new_callable_incompatible_with_autospec  sH    xi 	 	
 	c3Y 	 	
r"   c                ^    ! R  R\         4      p\        \        \        \         V3pV Fk  pR Fb  pVR/p\	        \
        3RV/VB pVP                  4       p VP                  pV P                  \        \        VR4       VP                  4        Kd  	  Km  	  R#   TP                  4        i ; i)c                       ] tR tRtRtR# )>PatchTest.test_new_callable_inherit_for_mocks.<locals>.MockSubi  r#   Nr$   r%   r&   r'   r(   r#   r"   r   MockSubr,        r"   r.  Tr  r<  Nr  )r   r	   r   r   r   r&  r  r   rs   r   r   r   )	r   r.  MockClassesKlassargr  r   rh  r4  s	   &        r   #test_new_callable_inherit_for_mocks-PatchTest.test_new_callable_inherit_for_mocks  s    	d 	 19dG
 !E)t(AA&AGGI ~~H%%ngxMFFH * ! FFHs   (BB,c                `    ! R  R\         4      p\        \        VRR7      pVP                  4       p V P	                  \        W14      4       V P                  \        \        VR4       VP                  4        V P                  VP                  \        4       R#   TP                  4        i ; i)c                   &   a  ] tR tRt o R tRtV tR# )>PatchTest.test_new_callable_inherit_non_mock.<locals>.NotAMocki  c                    Wn         R # r   r   )r   r   s   &&r   r=   GPatchTest.test_new_callable_inherit_non_mock.<locals>.NotAMock.__init__  s     	r"   r   N)r$   r%   r&   r'   r=   r(   r)   rS   s   @r   NotAMockr7    s     ! !r"   r:  Tr  r   N)r5   r   r&  r  ru   r   rs   r   r   r   r   r   r9   )r   r:  r   rh  s   &   r   "test_new_callable_inherit_non_mock,PatchTest.test_new_callable_inherit_non_mock  s}    	!v 	! (=GGI	OOK45ngq.IFFH% FFHs   6B B-c                   aa V o\         o ! VV3R  lR\        4      p\        \        \        R7      ! V4      pV! 4       P                  4        V! 4       P                  4        V P                  \         S4       R# )c                   <   <a  ] tR tRt o VV3R ltR tR tRtV tR# )>PatchTest.test_new_callable_class_decorating.<locals>.SomeTesti  c                   < SP                   ! \        S4       SP                  ! \        V4       SP                  ! \        \        4       R # r   )r  r9   r  r   r   )r   mock_foor   r   s   &&r   r  DPatchTest.test_new_callable_class_decorating.<locals>.SomeTest._test  s1      h/c8,%%c95r"   c                (    V P                  V4       R # r   r  r   rA  s   &&r   test_twoGPatchTest.test_new_callable_class_decorating.<locals>.SomeTest.test_two      

8$r"   c                (    V P                  V4       R # r   rD  rE  s   &&r   test_oneGPatchTest.test_new_callable_class_decorating.<locals>.SomeTest.test_one  rH  r"   r#   N	r$   r%   r&   r'   r  rF  rJ  r(   r)   )r*   r   r   s   @r   SomeTestr?    s     6
%% %r"   rM  r  N)r9   r5   r   r&  r   rJ  rF  r  )r   rM  r   r   s   & @@r   "test_new_callable_class_decorating,PatchTest.test_new_callable_class_decorating  s[    
	% 
	%v 
	% 	:8D

c8$r"   c                  a a \         o\         P                  p\         P                  p\        P                  ! \
        ^^R7      p\        P                  ! \         ^^R7      pW43 F  pVP                  4         S P                  \         S4       S P                  \         P                  ^4       S P                  \         P                  ^4       VP                  4        S P                  \         S4       S P                  \         P                  V4       S P                  \         P                  V4       K  	  \        P                  ! \
        ^^R7      VV 3R l4       pV! 4        R#   TP                  4        i ; i)r  )r@   rD   c                     < SP                  \        S 4       SP                  \        P                  ^4       SP                  \        P                  ^4       R# r  N)r  r9   r   r@   rD   )original_foor   s   r   r   +PatchTest.test_patch_multiple.<locals>.test"  s9    MM#|,SUUA&SUUA&r"   N)
r9   r@   rD   r   multipler&  r  r  r   r   )r   
original_f
original_gpatcher1patcher2r!  r   rS  s   f      @r   test_patch_multiplePatchTest.test_patch_multiple  s   UU
UU
>>(a15>>#a0)GMMOc<0  *  *MM#|,SUUJ/SUUJ/ * 
A	+	' 
,	'
 	 s   :AE**E<c                    V P                  \        \        P                  \        4       V P                  \        \        P                  \
        4       R # r   )rs   r$  r   rU  r&  r9   rC   s   &r   test_patch_multiple_no_kwargs'PatchTest.test_patch_multiple_no_kwargs+  s.    *ennh?*ennc:r"   c                D  a a \         o\         P                  p\         P                  p\        P                  ! \
        \        ^\        R7      VV 3R l4       pV! 4        S P                  \         P                  V4       S P                  \         P                  V4       R# )r  r@   rD   rU   c                 p  < SP                  \        S4       SP                  \        P                  V 4       SP                  \        P                  ^4       SP                  \        P
                  V4       SP                  \        V \        4      4       SP                  \        V\        4      4       R# rR  	r  r9   r@   r   rD   rU   ru   r   r   )r@   rU   rS  r   s   &&r   r   8PatchTest.test_patch_multiple_create_mocks.<locals>.test5  so    MM#|,MM#%%#SUUA&MM#''3'OOK956OOKY78r"   Nr9   r@   rD   r   rU  r&  r   r   )r   rV  rW  r   rS  s   f   @r    test_patch_multiple_create_mocks*PatchTest.test_patch_multiple_create_mocks0  sj    UU
UU
	Gqg	>	9 
?	9 	
+
+r"   c                  a  \         P                  p\         P                  p\        P                  ! \         R ^4      pR Vn        \        P                  ! \         R\        4      pRVn        V.Vn        VV 3R l4       pV! 4        S P                  \         P                  V4       S P                  \         P                  V4       R# )r@   rD   c                    < SP                  \        P                  V 4       SP                  \        P                  ^4       R# rR  )r  r9   rD   r   r@   )rD   r   s   &r   r   HPatchTest.test_patch_multiple_create_mocks_different_order.<locals>.testN  s)    MM#%%#SUUA&r"   N)	r9   r@   rD   r   r5   attribute_namer   additional_patchersr   )r   rV  rW  r!  r  r   s   f     r   0test_patch_multiple_create_mocks_different_order:PatchTest.test_patch_multiple_create_mocks_different_orderC  s    UU
UU
,,sC+!$S#w/"',g#		' 
	' 	
+
+r"   c                n  a aa \         o\         P                  p\         P                  p\        P                  ! \
        \        R 7      \        P                  ! \
        \        R7      \        \
        R,           4      V3R l4       4       4       p\        P                  ! \
        \        R 7      \        \
        R,           4      \        P                  ! \
        \        R7      V3R l4       4       4       p\        \
        R,           4      \        P                  ! \
        \        R 7      \        P                  ! \
        \        R7      V3R l4       4       4       pVV 3R loV! 4        V! 4        V! 4        S P                  \         P                  V4       S P                  \         P                  V4       R# ))r@   r  z.gc                    < S! V 3/ VB  R # r   r#   rD   r  r  s   &,r   test1?PatchTest.test_patch_multiple_stacked_decorators.<locals>.test1]       !vr"   c                    < S! V 3/ VB  R # r   r#   rp  s   &,r   test2?PatchTest.test_patch_multiple_stacked_decorators.<locals>.test2c  rs  r"   c                    < S! V 3/ VB  R # r   r#   rp  s   &,r   test3?PatchTest.test_patch_multiple_stacked_decorators.<locals>.test3i  rs  r"   c                   < VP                  R 4      pVP                  R4      pSP                  V4       SP                  \        S4       SP                  \        P                  V4       SP                  \        P
                  V 4       SP                  \        P                  V4       SP                  \        V\        4      4       SP                  \        V \        4      4       SP                  \        V\        4      4       R# )r@   rU   N)
poprv   r  r9   r@   rD   rU   ru   r   r   )rD   r  r@   rU   rS  r   s   &,  r   r  ?PatchTest.test_patch_multiple_stacked_decorators.<locals>._testo  s    

3A**U#CV$MM#|,MM#%%#MM#%%#MM#''3'OOK956OOK956OOKY78r"   Nrd  )r   rV  rW  rq  ru  rx  r  rS  s   f     @@r   &test_patch_multiple_stacked_decorators0PatchTest.test_patch_multiple_stacked_decoratorsX  s   UU
UU
	G	,	g	.	x$		 
  
/ 
-	 
G	,	x$		g	.	 
/ 
  
-	 
x$		G	,	g	.	 
/ 
- 
 		9 	
+
+r"   c                "   \         p\         P                  p\         P                  p\        P                  ! \
        \        ^\        R7      pVP                  4       p VR,          pVR,          pV P                  \        V4      \        RR.4      4       V P                  \         V4       V P                  \         P                  V4       V P                  \         P                  V4       V P                  \        V\        4      4       V P                  \        V\        4      4       VP                  4        V P                  \         P                  V4       V P                  \         P                  V4       R#   TP                  4        i ; i)r  r`  r@   rU   N)r9   r@   rD   r   rU  r&  r   r  r   setr  rU   ru   r   r   r   )r   rS  rV  rW  r!  r  r@   rU   s   &       r   (test_patch_multiple_create_mocks_patcher2PatchTest.test_patch_multiple_create_mocks_patcher  s   UU
UU
..WwG	sA-CS[#sEl*;<MM#|,MM#%%#MM#''3'OOK956OOKY78LLN
+
+ LLNs   CE< <Fc                  aa V o\         o\         P                  p\         P                  p ! VV3R  lR\        4      p\        P
                  ! \        \        ^\        R7      ! V4      pV! 4       pVP                  4        VP                  4        V P                  \         P                  V4       V P                  \         P                  V4       R# )c                   <   <a  ] tR tRt o VV3R ltR tR tRtV tR# )@PatchTest.test_patch_multiple_decorating_class.<locals>.SomeTesti  c                |  < SP                   ! \        S4       SP                   ! \        P                  V4       SP                  ! \        P                  ^4       SP                   ! \        P
                  V4       SP                  ! \        V\        4      4       SP                  ! \        V\        4      4       R# rR  rb  )r   r@   rU   rS  r   s   &&&r   r  FPatchTest.test_patch_multiple_decorating_class.<locals>.SomeTest._test  so    c<0ceeQ'  *cggs+Ay 9:C ;<r"   c                (    V P                  W4       R # r   rD  r   r@   rU   s   &&&r   rF  IPatchTest.test_patch_multiple_decorating_class.<locals>.SomeTest.test_two      

1"r"   c                (    V P                  W4       R # r   rD  r  s   &&&r   rJ  IPatchTest.test_patch_multiple_decorating_class.<locals>.SomeTest.test_one  r  r"   r#   NrL  )r*   rS  r   s   @r   rM  r    s     =## #r"   rM  r`  N)r9   r@   rD   r5   r   rU  r&  r   rJ  rF  r   )r   rV  rW  rM  rr  rS  r   s   &    @@r   $test_patch_multiple_decorating_class.PatchTest.test_patch_multiple_decorating_class  s    UU
UU
	# 	#v 	# >>1'

 

+
+r"   c                   \         P                  ! \        R R7      pV P                  \        VP
                  4       \         P                  ! \        R RR7      pVP                  4         V P                  \        P                  R 4       VP                  4        V P                  \        R 4       R#   TP                  4        i ; i)blam)r  T)r  r<  N)
r   rU  r9   rs   r   r  r   r  r   rK  r'  s   & r   test_patch_multiple_create$PatchTest.test_patch_multiple_create  s    ..62.'--8..6$?	SXXv.LLNc6* LLNs   + B3 3Cc                |   \         P                  ! \        \        R R.R7      pVP	                  4       p V P                  \        P                  VR,          4       \        P                  P                  ^4       \        P                  P                  ^4       \        P                  P                  P                  ^4       \        P                  P                  P                  ^4       V P                  \        \        \        P                  RR4       VP                  4        R#   TP                  4        i ; i)r<   rZ   )rU   r	  rU   r_  N)r   rU  r9   r   r  r   rU   r<   rZ   r  rs   r   r-   r   )r   r!  r  s   &  r   test_patch_multiple_spec_set&PatchTest.test_patch_multiple_spec_set  s     ..'S#JG	SWWfUm4GGIIaLGGIIaLGGII((+GGII((+ngswwTJLLNGLLNs   C"D) )D;c                T    ! R  R\         4      p\        P                  ! \        \        \        VR7      pVP                  4       p V P                  \        P                  VR,          4       V P                  \        P                  VR,          4       V P                  \        P                  V4       V P                  \        P                  V4       V P                  \        P                  \        P                  4       VP                  4        R#   TP                  4        i ; i)c                       ] tR tRtRtR# )9PatchTest.test_patch_multiple_new_callable.<locals>.Thingi  r#   Nr-  r#   r"   r   Thingr    r/  r"   r  )r@   rD   r  r@   rD   N)r5   r   rU  r9   r   r  r  r@   rD   r   r  r   )r   r  r!  r  s   &   r    test_patch_multiple_new_callable*PatchTest.test_patch_multiple_new_callable  s    	F 	 ..7gE
 	MM#%%-MM#%%-!!#%%/!!#%%/SUUCEE*LLNGLLNs   B<D D'c                H   \         P                  p\         P                  p\        P                  ! \         R ^4      \        P                  ! \         R^4      \        P                  ! \         R^4      R 4       4       4       p\        P                  ! \         R^4      \        P                  ! \         R ^4      \        P                  ! \         R^4      R 4       4       4       p\        P                  ! \         R ^4      \        P                  ! \         R^4      \        P                  ! \         R^4      R 4       4       4       pW4V3 FY  pV P                  \        V4       V P                  \         P                  V4       V P                  \         P                  V4       K[  	  R# )rD   missingr@   c                      R # r   r#   r#   r"   r   thing13PatchTest.test_nested_patch_failure.<locals>.thing1       r"   c                      R # r   r#   r#   r"   r   thing23PatchTest.test_nested_patch_failure.<locals>.thing2  r  r"   c                      R # r   r#   r#   r"   r   thing33PatchTest.test_nested_patch_failure.<locals>.thing3  r  r"   N)r9   r@   rD   r   r5   rs   r   r   )r   rV  rW  r  r  r  funcs   &      r   test_nested_patch_failure#PatchTest.test_nested_patch_failure  s0   UU
UU
	c3	"	c9a	(	c3	" 
# 
) 
# 		c9a	(	c3	"	c3	" 
# 
# 
) 		c3	"	c3	"	c9a	( 
) 
# 
# 	F*Dnd3SUUJ/SUUJ/ +r"   c                   \         P                  p\         P                  p\         P                  pR  p\        P
                  ! \         R^4      \        P
                  ! \         RVR7      \        P
                  ! \         R^4      R 4       4       4       p\        P
                  ! \         RVR7      \        P
                  ! \         R^4      \        P
                  ! \         R^4      R 4       4       4       p\        P
                  ! \         R^4      \        P
                  ! \         R^4      \        P
                  ! \         RVR7      R 4       4       4       pWVV3 Fy  pV P                  \        V4       V P                  \         P                  V4       V P                  \         P                  V4       V P                  \         P                  V4       K{  	  R# )	c                      \        R 4      hcrasherr  r#   r"   r   r  4PatchTest.test_new_callable_failure.<locals>.crasher      I&&r"   rD   rU   r  r@   c                      R # r   r#   r#   r"   r   r  3PatchTest.test_new_callable_failure.<locals>.thing1  r  r"   c                      R # r   r#   r#   r"   r   r  3PatchTest.test_new_callable_failure.<locals>.thing2  r  r"   c                      R # r   r#   r#   r"   r   r  3PatchTest.test_new_callable_failure.<locals>.thing3  r  r"   N)	r9   r@   rD   rU   r   r5   rs   rE  r   )	r   rV  rW  rS  r  r  r  r  r  s	   &        r   test_new_callable_failure#PatchTest.test_new_callable_failure  sT   UU
UU
ww	' 
c3	"	c5w	7	c3	" 
# 
8 
# 		c5w	7	c3	"	c3	" 
# 
# 
8 		c3	"	c3	"	c5w	7 
8 
# 
# 	F*Di.SUUJ/SUUJ/SWWl3	 +r"   c                   \         P                  p\         P                  p\        P                  ! \         R ^4      pR Vn        \        P                  ! \         R^4      pRVn        \        P                  ! \         R^4      pRVn        WE.WT.3 Fg  pWcn        VR 4       pV P                  \        V4       V P                  \         P                  V4       V P                  \         P                  V4       Ki  	  R# )r@   rD   r  c                      R # r   r#   r#   r"   r   r  3PatchTest.test_patch_multiple_failure.<locals>.func4  rQ  r"   N)
r9   r@   rD   r   r5   rj  rk  rs   r   r   )r   rV  rW  r!  goodbadadditionalsr  s   &       r   test_patch_multiple_failure%PatchTest.test_patch_multiple_failure$  s    UU
UU
,,sC+!$||Ca(!ll3	1-& ;3K*5' nd3SUUJ/SUUJ/ 4r"   c                b   \         P                  p\         P                  p\         P                  pR  p\        P
                  ! \         R^4      pRVn        \        P
                  ! \         R^4      pRVn        \        P
                  ! \         RVR7      pRVn        Wg.Wv.3 F  pWn        VR 4       p	V P                  \        V	4       V P                  \         P                  V4       V P                  \         P                  V4       V P                  \         P                  V4       K  	  R# )c                      \        R 4      hr  r  r#   r"   r   r  CPatchTest.test_patch_multiple_new_callable_failure.<locals>.crasherA  r  r"   r@   rD   rU   r  c                      R # r   r#   r#   r"   r   r  @PatchTest.test_patch_multiple_new_callable_failure.<locals>.funcP  rQ  r"   N)r9   r@   rD   rU   r   r5   rj  rk  rs   rE  r   )
r   rV  rW  rS  r  r!  r  r  r  r  s
   &         r   (test_patch_multiple_new_callable_failure2PatchTest.test_patch_multiple_new_callable_failure<  s    UU
UU
ww	' ,,sC+!$||Ca(!ll3G<" ;3K*5' i.SUUJ/SUUJ/SWWl3 4r"   c                   a a \        R \        3RR/4      pV! 4       o\        P                  ! SRR7      VV 3R l4       pV! 4        S P	                  SP
                  R4       R# )r9   fishtastynearly gone)r  c                  @   < SP                  S P                  R 4       R# )r  N)r   r  r  s   r   r   =PatchTest.test_patch_multiple_string_subclasses.<locals>.test\  s    SXX}5r"   N)r  strr   rU  r   r  )r   r9   r   rU   s   f  @r   %test_patch_multiple_string_subclasses/PatchTest.test_patch_multiple_string_subclassesY  sW    53&67"34e	-	0	6 
1	6 	7+r"   zunittest.mock.patch.TEST_PREFIXrU   c                n    ! R  R\         4      p\        P                   ! VRR4      ! V4      pV! 4       pV P                  VP                  4       R4       V P                  VP	                  4       R4       V P                  VP                  4       R4       V P                  VP                  4       R4       R# )c                   <   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	-PatchTest.test_patch_test_prefix.<locals>.Fooif  r   c                    V P                   # r   rr  rC   s   &r   foo_one5PatchTest.test_patch_test_prefix.<locals>.Foo.foo_onei      zz!r"   c                    V P                   # r   r  rC   s   &r   foo_two5PatchTest.test_patch_test_prefix.<locals>.Foo.foo_twok  r  r"   c                    V P                   # r   r  rC   s   &r   rJ  6PatchTest.test_patch_test_prefix.<locals>.Foo.test_onem  r  r"   c                    V P                   # r   r  rC   s   &r   rF  6PatchTest.test_patch_test_prefix.<locals>.Foo.test_twoo  r  r"   r#   N)r$   r%   r&   r'   rr  r  r  rJ  rF  r(   r)   rS   s   @r   r9   r  f  s#     E"""" "r"   r9   rr  changedr   N)r5   r   r   r  r  rJ  rF  )r   r9   rU   s   &  r   test_patch_test_prefix PatchTest.test_patch_test_prefixd  s    
	"& 
	" ll33C8e	2	244r"   rF   c                  a  ! V3R  lR\         4      pRR/o\        P                  ! SRR7      ! V4      pV! 4       pV P                  VP	                  4       RR/4       V P                  VP                  4       RR/4       V P                  VP                  4       RR/4       V P                  VP                  4       RR/4       R# )c                   R   <a  ] tR tRt o V3R ltV3R ltV3R ltV3R ltRtV t	R# )2PatchTest.test_patch_dict_test_prefix.<locals>.Fooi}  c                   < \        S4      # r   r  r   the_dicts   &r   bar_one:PatchTest.test_patch_dict_test_prefix.<locals>.Foo.bar_one~      H~%r"   c                   < \        S4      # r   r  r  s   &r   bar_two:PatchTest.test_patch_dict_test_prefix.<locals>.Foo.bar_two  r  r"   c                   < \        S4      # r   r  r  s   &r   rJ  ;PatchTest.test_patch_dict_test_prefix.<locals>.Foo.test_one  r  r"   c                   < \        S4      # r   r  r  s   &r   rF  ;PatchTest.test_patch_dict_test_prefix.<locals>.Foo.test_two  r  r"   r#   N)
r$   r%   r&   r'   r  r  rJ  rF  r(   r)   )r*   r  s   @r   r9   r  }  s     &&&& &r"   r9   keyr   r  )r  N)r5   r   r  r   r  r  rJ  rF  )r   r9   rU   r  s   &  @r   test_patch_dict_test_prefix%PatchTest.test_patch_dict_test_prefix{  s    	&& 	& :&jjy1#6U	(:;	(:;%)<=%)<=r"   c                   R F  p\        R\        ,          3/ VR/B pVP                  4       p V P                  R\	        V4      4       V P                  R\	        VP
                  4      4       V P                  R\	        V! 4       4      4       V P                  R\	        V! 4       P
                  4      4       VP                  4        K  	  R#   TP                  4        i ; i)	r   r   Tz name='SomeClass'z! name='SomeClass.class_attribute'z name='SomeClass()'z# name='SomeClass().class_attribute'Nr   r  r	  )r   r$   r  r  r  r   r   )r   r2  r   rh  s   &   r   test_patch_with_spec_mock_repr(PatchTest.test_patch_with_spec_mock_repr  s    3Cnx/?C;?A	A147;A"1#4#4573T!#Y?C"13#6#679  4 s   B
CC"c           	     >   \        R RR7      ;_uu_ 4       pV P                  R\        VP                  P	                  4       4      4       V P                  R\        VP                  4       P	                  4       4      4       RRR4       R#   + '       g   i     R# ; i)#test.test_unittest.testmock.supportTr  z" name='support.SomeClass.wibble()'z$ name='support.SomeClass().wibble()'N)r   r  r  r   r   )r   rh  s   & r   test_patch_nested_autospec_repr)PatchTest.test_patch_nested_autospec_repr  sl    84HHAMM>q{{11346MM@q{{}33568 IHHHs   A+BB	c                   R EF  p\        R\        ,          3/ VR/B pVP                  4       p VP                  4        \        P                  ! 4       .pV P                  VP                  V4       V P                  VP                  V4       V P                  VP                  P                  \	        4       .4       V! 4       pVP                  \	        4       4       V P                  VP                  V4       VP                  4        VP                  \	        4       P                  4       4       V P                  VP                  V4       V P                  VP                  \        P                  ! 4       .4       V P                  VP                  P                  \	        4       .4       V P                  VP                  \        P                  ! 4       .4       VP                  4        EK  	  R#   TP                  4        i ; i)r   r   TNr  )
r   r$   r  r   r   r   
mock_callsmethod_callsappendr   )r   r2  r   rh  kallsr  s   &     r   test_mock_calls_with_patch$PatchTest.test_mock_calls_with_patch  sZ   3Cnx/?C;?A	A
  u5  7  !4!4tvh?TV$  u5TV]]_-  u5  !2!2T[[]OD  !9!9DF8D  !4!4t{{}oF/ 4. s   F+G33Hc                   \        R 4      pV P                  \        VP                  4       \	        R4      ;_uu_ 4        \        4       pV\        P                  R&   ^Vn        \        R 4      p^Vn        VP                  4        VP                  4        RRR4       V P                  XP                  ^4       R#   + '       g   i     L.; i)squizz.squozzsquizzN)r   rs   ImportErrorr  r   r   r  r  squozzr   r   )r   p1r	  s   &  r   test_patch_imports_lazily#PatchTest.test_patch_imports_lazily  s    ?#+rxx0XVF$*CKK!FM'BFMHHJGGI  	* s   AB<<C	c                  aa  ! R  R4      o ! V3R lR\         4      oV3R lpV! R4      R 4       p\        R4      ;_uu_ 4        \        4       pV\        P                  R&   V P                  \        V4       RRR4       V P                  SP                  ^ ,          \        4       V P                  SP                  ^,          R	4       V P                  SP                  ^,          R
4       R#   + '       g   i     L; i)c                       ] tR tRtRtRtR# );PatchTest.test_patch_propagates_exc_on_exit.<locals>.holderi  Nr#   NNN)r$   r%   r&   r'   r  r(   r#   r"   r   holderr    s    'Hr"   r  c                   6   <a  ] tR tRt o RV3R llt]tRtV tR# )APatchTest.test_patch_propagates_exc_on_exit.<locals>.custom_patchi  Nc                H   < \         P                  ! WW#4       WV3Sn        R # r   )r   r.  r  )r   etypevaltbr  s   &&&&r   r.  JPatchTest.test_patch_propagates_exc_on_exit.<locals>.custom_patch.__exit__  s    S5"'b.r"   r#   r  )r$   r%   r&   r'   r.  r   r(   r)   )r*   r  s   @r   custom_patchr    s     1 Dr"   r  c                 D   < \        V 4      w  rS! W\        R RR R R / 4	      # )NF)r   r   )r  getterr   r  s   &  r   with_custom_patchFPatchTest.test_patch_propagates_exc_on_exit.<locals>.with_custom_patch  s/     +F 3F7D%dB r"   r  c                     \         hr   )r2  r   s   &r   r   9PatchTest.test_patch_propagates_exc_on_exit.<locals>.test  s    r"   r	  Nzexception value not propagatedz"exception traceback not propagated)
r   r   r   r  r  rs   r2  r  r  assertIsNotNone)r   r  r   r	  r  r  s   &   @@r   !test_patch_propagates_exc_on_exit+PatchTest.test_patch_propagates_exc_on_exit  s    	( 	(	6 		 
?	+	 
,	 XVF$*CKK!lD1	  	fooa(,7V__Q/<	>V__Q/@	B s   4C11D	c           	       a  \         P                  P                  \         P                  P                  \        P
                  4      R R4      pR pV 3R lp\        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R	4       V! R
4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       V! R	4       V! R
4       V! R4       V! R4       RRR4       RRR4       R#   + '       g   i     EL6; i  + '       g   i     ELB; i  + '       g   i     EL; i  + '       g   i     EL!; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)test_importrj  c                 \    \        V 4      pVP                  4        VP                  4        R # r   r   r  r   r   r   s   & r   check>PatchTest.test_name_resolution_import_rebinding.<locals>.check      dAGGIFFHr"   c                 ^   < \        V 4      pSP                  \        VP                  4       R # r   r   rs   r   r  r   r   r   s   & r   check_errorDPatchTest.test_name_resolution_import_rebinding.<locals>.check_error       dAnagg6r"   package3zpackage3.submodulezpackage3.submodule.A.attrzpackage3.submodule.B.attrNzpackage3.submodule:A.attrzpackage3.submodule:B.attrzpackage3:submodule.B.attrzpackage3:submodule.A.attrr  pathjoindirnamer   __file__r   r   r   r6  r+  r1  s   f   r   %test_name_resolution_import_rebinding/PatchTest.test_name_resolution_import_rebinding  s   
 ww||BGGOODMM:M6R		7 Z!566d8K8K-.34 9L6 Z!566d8K8K-.34 9L6 Z!566d8K8K-.34-.34-.34 9L6 Z!566d8K8K-.34-.34-.34 9L66 9L8K8K666 9L8K8K666 9L8K66 9L8K666   +G?F=	G4G9G%	G9=H 1H	H &I:1H3	+I=G	GG"	%G60	G99H
	HH  H0	3I>II	c           	       a  \         P                  P                  \         P                  P                  \        P
                  4      R R4      pR pV 3R lp\        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R	4       V! R
4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       RRR4       RRR4       \        RR4      ;_uu_ 4        \        V4      ;_uu_ 4        V! R4       V! R4       V! R	4       V! R
4       V! R4       V! R4       RRR4       RRR4       R#   + '       g   i     EL6; i  + '       g   i     ELB; i  + '       g   i     EL; i  + '       g   i     EL!; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)r'  rj  c                 \    \        V 4      pVP                  4        VP                  4        R # r   r)  r*  s   & r   r+  ?PatchTest.test_name_resolution_import_rebinding2.<locals>.check  r-  r"   c                 ^   < \        V 4      pSP                  \        VP                  4       R # r   r/  r0  s   & r   r1  EPatchTest.test_name_resolution_import_rebinding2.<locals>.check_error  r3  r"   package4zpackage4.submodulezpackage4.submodule.A.attrzpackage4.submodule.B.attrNzpackage4.submodule:A.attrzpackage4.submodule:B.attrzpackage4:submodule.B.attrzpackage4:submodule.A.attrr5  r:  s   f   r   &test_name_resolution_import_rebinding20PatchTest.test_name_resolution_import_rebinding2  s   ww||BGGOODMM:M6R		7 Z!566d8K8K-.34 9L6 Z!566d8K8K-.34 9L6 Z!566d8K8K-.34-.34-.34 9L6 Z!566d8K8K-.34-.34-.34 9L66 9L8K8K666 9L8K8K666 9L8K66 9L8K666r=  c                $   R F  p\        R\        ,          3RR/VR/B pV P                  \        VP                  4       V P                  \
        R 4       \        \        3RR/VR/B pVP	                  4        VP                  4        K  	  R# )r   z%s.doesnotexistr<  Tc                      \         # r   )doesnotexistr#   r"   r   r   1PatchTest.test_create_and_specs.<locals>.<lambda>;  s    r"   Nr   r	  r  )r   r$   rs   rt   r  rE  MODNAMEr   )r   kwargr   s   &  r   test_create_and_specsPatchTest.test_create_and_specs6  s    5E'(2 '4 ''Ai1i)=> g<d<udm<AGGIFFH 6r"   c                   \         pR FM  p\        \        3R^ /V^ /B pV P                  \        VP
                  4       V P                  \         V4       KO  	  R FM  p\        \        3R^ /V^ /B pV P                  \        VP
                  4       V P                  \         V4       KO  	  R FM  p\        \        3R ^ /V^ /B pV P                  \        VP
                  4       V P                  \         V4       KO  	  R# )r   r	  r  Nr  r   r  )r	  r  )r   r   rK  rs   rt   r  r  )r   r   rL  r   s   &   r   test_multiple_specsPatchTest.test_multiple_specsC  s    )Eg88eQZ8Ai1MM(H- *
 *Eg88eQZ8Ai1MM(H- *
 .Eg4A4%4Ai1MM(H- .r"   c                    \        \        R R R R7      pVP                  4       p VP                   ^Vn        VP	                  4        R#   TP	                  4        i ; i)FrJ  N)r   rK  r  does_not_existr   )r   r   r   s   &  r    test_specs_false_instead_of_none*PatchTest.test_specs_false_instead_of_noneU  sF    'Fwwy	"#DFFHAFFHs   A
 
Ac                    R FR  p\        \        3/ V^ /B pVP                  4       p V P                  \        \
        VR4       VP                  4        KT  	  R#   TP                  4        i ; i)r   doesnotexitNr  )r   rK  r  rs   r   r   r   r   rL  r   rh  s   &   r   test_falsey_specPatchTest.test_falsey_spec`  sY    5Eg,%,A	A!!.'1mL 6 s   AA-c                   R Fq  p\        \        3RR/VR/B pVP                  4       p V P                  \        \
        VRR4       V P                  \        \        VR4       VP                  4        Ks  	  R#   TP                  4        i ; i)r   r	  TrH  r   NrP  )r   rK  r  rs   r   r-   r   r   rY  s   &   r   test_spec_set_truePatchTest.test_spec_set_truej  sw    )Eg>>>A	A!!.'1"0+?!!.'1nM * s   9A::Bc                    Rp\        \        VR7      pVP                  4       p V P                  \	        V4      4       VP                  4        R#   TP                  4        i ; i)__call__r   N)r`  )r   rK  r  ru   callabler   r   r   r   rh  s   &   r   test_callable_spec_as_list$PatchTest.test_callable_spec_as_listv  sF    '%GGI	OOHQK(FFHAFFH   A A#c                    Rp\        \        VR7      pVP                  4       p V P                  \	        V4      4       VP                  4        R#   TP                  4        i ; i)rU   r   N)rU   rF   )r   rK  r  rv   ra  r   rb  s   &   r   test_not_callable_spec_as_list(PatchTest.test_not_callable_spec_as_list  sH    '%GGI	Xa[)FFHAFFHre  c                ^  a aa \         P                  o\         P                  o\         P                  p\	        R \
        4      P                  4        \	        R\        4      P                  4        \	        R4      VV V3R l4       pV! 4        S P                  \         P                  V4       R# )	os.unlinkos.chdirzos.pathc                    < \         P                  ! 4        SP                  \        P                  V 4       SP                  \        P
                  S4       SP                  \        P                  S4       R # r   )r   stopallr  r  r6  unlinkchdir)	mock_pathro  r   rn  s   &r   r  -PatchTest.test_patch_stopall.<locals>.patched  sB    MMOMM"''9-MM"))V,MM"((E*r"   N)	r  rn  ro  r6  r   r   r  r   r  )r   r6  r  ro  rn  s   f  @@r   test_patch_stopallPatchTest.test_patch_stopall  st    wwk9%++-j.)//1	y		+ 
	+ 		bggt$r"   c                   aa . o ! R  R\         4      oVV3R lpR Uu. uF  q!! V4      P                  4       NK  	   p\        P                  ! 4        V P	                  S. RO4       R# u upi )c                   "    ] tR tRtR;t;ttRtR# )*PatchTest.test_stopall_lifo.<locals>.thingi  Nr#   )r$   r%   r&   r'   onetwothreer(   r#   r"   r   rr  rv    s     $$C$#r"   rr  c                 X   <a a  ! V VV3R  lR\         4      oS! V3R lS RRRRRR/ 4	      # )c                   :   <a a ] tR tRt oV VVV3R ltRtVtV ;t# )?PatchTest.test_stopall_lifo.<locals>.get_patch.<locals>.mypatchi  c                B   < SP                  S4       \        SV `  4       # r   )r  superr   )r   	__class__r   mypatchstoppeds   &r   r   DPatchTest.test_stopall_lifo.<locals>.get_patch.<locals>.mypatch.stop  s    NN9- $466r"   r#   )r$   r%   r&   r'   r   r(   r)   __classcell__)r  r*   r   r  r  s   @@r   r  r|    s     7 7 7r"   r  c                     < S # r   r#   r  s   r   r   @PatchTest.test_stopall_lifo.<locals>.get_patch.<locals>.<lambda>  s    5r"   NF)r   )r   r  r  rr  s   f@r   	get_patch.PatchTest.test_stopall_lifo.<locals>.get_patch  s6    7 7& 7 =)T4 $dB8 8r"   N)rw  rx  ry  )ry  rx  rw  )r5   r  r   rm  r   )r   r  r  r  rr  s   &  @@r   test_stopall_lifoPatchTest.test_stopall_lifo  s]    	%F 	%	8 ,CC+BC3			+BC"9: 	Ds   A*c                f  a / p^R/p^R^R/oVP                  4       pVP                  4       pSP                  4       p\        P                  ! V^R^R/4      P                  4        \        P                  ! V^R/4      P                  4        \        P                  ! S4      V3R l4       pV! 4        V P	                  W4       V P	                  W$4       V P                  SV4       \        P                  ! 4        V P                  W4       V P                  W$4       V P                  SV4       R# )	r  r<   ABIIIrZ   c                     < S ^ R# r  r#   )dic3s   r   r  2PatchTest.test_patch_dict_stopall.<locals>.patched  s
    Qr"   N)r  r   r  r  r   r   rm  )r   dic1dic2origdic1origdic2origdic3r  r  s   &      @r   test_patch_dict_stopall!PatchTest.test_patch_dict_stopall  s    3x3399;99;99;

4!S!T*+113

4!S"((*	D		 
	 		D+D+x(((x(r"   c                `   \         P                  p\         P                  p/ p^R^R/pVP                  4       pVP                  4       p\	        R\
        4      P                  4        \	        R\        4      P                  4        \        P                  ! V^R^R/4      P                  4        \        P                  ! V4      P                  4        V^ V P                  \         P                  V4       V P                  \         P                  V4       V P                  W54       V P                  WF4       \        P                  ! 4        V P                  \         P                  V4       V P                  \         P                  V4       V P                  W54       V P                  WF4       R# )r  r  r  rj  rk  r  r  N)r  rn  ro  r  r   r   r  r   r  r  r   rm  r  r   )r   original_unlinkoriginal_chdirr  r  r  r  s   &      r   !test_patch_and_patch_dict_stopall+PatchTest.test_patch_and_patch_dict_stopall  s,   ))3399;99;k9%++-j.)//1

4!S!T*+113

4 GO4>2D+D+bii1bhh/((r"   c                   RR lp\         P                  ! VRR4      ;_uu_ 4        V P                  V! 4       ^4       RRR4       V P                  V! 4       ^ 4       VP                  p\         P                  ! VRR4      ;_uu_ 4        V P                  VP                  R4       RRR4       V P                  VP                  V4       \         P                  ! VRR4      ;_uu_ 4        V P                  VP                  R4       RRR4       V P                  VP                  \
        4       \         P                  ! VR\        R.4      4      ;_uu_ 4        V P                  VP                  \        R.4      4       RRR4       V P                  VP                  \        4       4       R	^ /R
 lp\         P                  ! VR\        R.4      4      ;_uu_ 4        V P                  V! 4       ^4       RRR4       V P                  V! 4       ^ 4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL@; i  + '       g   i     L; i  + '       g   i     Lx; i)r   c                    V # )TESTr#   )r<  s   &r   rU   )PatchTest.test_special_attrs.<locals>.foo  s    Hr"   __defaults__N__doc__FUNr%   
testpatch2__annotations__r<  c                     V # r   r#   )r<  r<   s   $*r   rU   r    s    Hr"   __kwdefaults__)r   r  )sr  )r<  r  )r   r5   r   r  r%   r$   r  r  )r   rU   orig_docs   &  r   test_special_attrsPatchTest.test_special_attrs  s   	 \\#~u55SUA& 6";;\\#y%00S[[%0 1h/\\#|\::S^^\: ;2\\#0$
|2DEES00$
|2DE F,,df5	a 	\\#/zl1CDDSUA& E"+ 655
 100 ;:: FE EDs;   H	H**H>'II%H'	*H;	>I	I"	%I5	c                   \        4       p\        4       VR &   RVR&   VP                  4       p\        \	        R\        ^4      4      4      p\        VP                  4       4      V,           p\        P                  ! V\        V4      4      ;_uu_ 4        V P                  \        VP                  4       4      V4       RRR4       V P                  W4       \        P                  ! W4      ;_uu_ 4        V P                  \        VP                  4       4      V4       RRR4       V P                  W4       R#   + '       g   i     L; i  + '       g   i     L6; i)r<   pythonrZ   cdefghijklmnopqrstuvwxyzN)
r   r5   r  r  ziprangeitemsr   r  r   )r   rU   r   update_valuespatched_valuess   &    r   test_patch_orderdictPatchTest.test_patch_orderdict  s    m8CC88:S!;U2YGHciik*]:ZZ[788T#))+.? 9 	'ZZ++T#))+.? , 	' 98
 ,+s   *D94*E9E		E	c                <   ^ RI p\        P                  ! R4      ;_uu_ 4        \        P                  R \        P                  R \        P                  R \        P                  R \        R4      R 4       pV! 4        RRR4       R#   + '       g   i     R# ; i)	r   Nzsys.modulesr  ztest.test_unittest.testmockztest.test_unittestr   %test.test_unittest.testmock.support.Xc                     R # r   r#   r!  s   &r   r   9PatchTest.test_dotted_but_module_not_loaded.<locals>.test  s    r"   )#test.test_unittest.testmock.supportr   r  r  r  r   s   & r   !test_dotted_but_module_not_loaded+PatchTest.test_dotted_but_module_not_loaded  sw     	3ZZ&&AB9:01F# :; <F '&&&s   AB

B	c           
     2    ! R  R4      pR^V! 4       3 FW  pV P                  VR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4        \        V4       RRR4       RRR4       KY  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)c                       ] tR tRtRtR# )*PatchTest.test_invalid_target.<locals>.Fooi!  r#   Nr-  r#   r"   r   r9   r  !  r/  r"   r9    )r  N)subTestrs   rt   r   )r   r9   r  s   &  r   test_invalid_targetPatchTest.test_invalid_target   si    	 	 2suoFV,,&&y11&M 2 -, &11 -,,s#   BA2B2B=BBc                    \        R \        4       ^R7      R 4       pV P                  \        4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)r  )r  r<  c                      R # r   r#   r#   r"   r   r   @PatchTest.test_cant_set_kwargs_when_passing_a_mock.<locals>.test+  s    r"   N)r   r5   rs   rt   r   s   & r   (test_cant_set_kwargs_when_passing_a_mock2PatchTest.test_cant_set_kwargs_when_passing_a_mock*  sB    	6FH	J 
Ky))F *)))s   AA	c                J    \        R \        4       R7      R 4       pV! 4        R# )z%test.test_unittest.testmock.support.gr  c                     R # r   r#   )_s   &r   r   /PatchTest.test_patch_proxy_object.<locals>.test1  r   r"   N)r   r   r   s   & r   test_patch_proxy_object!PatchTest.test_patch_proxy_object0  s&    	6Y[	Q	 
R	 	r"   r#   NT)~r$   r%   r&   r'   ry   r   r   r   r   r   r   r   r   r   r  r  r  r  r(  r/  r7  rF  rL  rT  rZ  rn  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r(  r+  r/  r3  r6  r9  rA  rE  rM  rP  r_  rs  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r%  r(  r3  r;  rN  rZ  r]  re  rl  r}  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r$  r;  rD  rM  rQ  rU  rZ  r]  rc  rg  rr  r  r  r  r  r  r  r  r  r  r(   r)   rS   s   @r   rq   rq   W   s    :
/6

//(!(>V	0'-T				6460.(6,0/,/4/ (B/6(>/4*	:
"&"020
+**/;/&
+&&&>4$4$
3
3)@F($--??4

9
)
)*

&& %*>;
,&,*(,V,2,B+ $024<004:, ,e45 55, ,e4> 5>*86+BD 5D5>
.$	%";")4)2#6(&&" r"   rq   __main__r  )-r  r  collectionsr   r  r   test.test_unittest.testmockr   r  r   r   test.support.import_helperr   test.test_importlib.utilr   unittest.mockr	   r
   r   r   r   r   r   r   r   r   r   r   r  r$   r   rK  r7   r   r   r   r   r5   r9   r&  r[   r]   TestCaserq   mainr#   r"   r   <module>r     s   
 
 
 #   / F 4 ,    ;;x 
(
" 	((&  h  ! !$^!! ^B? zMMO r"   