
    \e[                     @   d dl Z d dlmZ d dlZd dlmZ d dlmZ d dlm	Z	  G d dej                        Z G d d	ej                        Z G d
 dej                        Z G d dej                        Z G d dej                        Z G d dej                        Zy)    N)mock)base)excutils)	timeutilsc                       e Zd Zy)Fail1N__name__
__module____qualname__     @/usr/lib/python3/dist-packages/oslo_utils/tests/test_excutils.pyr   r          r   r   c                       e Zd Zy)Fail2Nr	   r   r   r   r   r      r   r   r   c                       e Zd Zd Zd Zy)CausedByTestc           	         | j                  t        t        j                  t        dt	        d            }| j                  |j                  t               |j                         }| j                  d|       | j                  d|       y )NI was brokenI have been broken)causer   )	assertRaisesr   r   raise_with_causer   assertIsInstancer   pformatassertIn)selfee_ps      r   test_caused_by_explicitz$CausedByTest.test_caused_by_explicit#   so    e&77#^$)*>$?  A 	aggu-iik*C0gs#r   c                     d }| j                  t        |      }| j                  |j                  t               |j                         }| j                  d|       | j                  d|       y )Nc                  l    	 t        d      # t         $ r t        j                  t        d       Y y w xY w)Nr   r   )r   r   r   r   r   r   r   raises_chainedz<CausedByTest.test_caused_by_implicit.<locals>.raises_chained/   s5    A011 A))%@As    #33r   r   )r   r   r   r   r   r   r   )r   r$   r   r    s       r   test_caused_by_implicitz$CausedByTest.test_caused_by_implicit-   sX    	A e^4aggu-iik*C0gs#r   N)r
   r   r   r!   r%   r   r   r   r   r   !   s    $$r   r   c                       e Zd Zd Zd Zd Zd Zd Z ej                  d      d        Z
d Z ej                  d      d	        Zd
 Zy)SaveAndReraiseTestc                 6    d }| j                  t        |       y )Nc                      	 t        d      # t        $ rD t        j                         5 } d| _        d d d        n# 1 sw Y   nxY w j                          Y y w xY w)NI brokeF)IOError	Exceptionr   save_and_reraise_exceptionreraiseforce_reraise)r   s    r   _force_reraisezQSaveAndReraiseTest.test_save_and_reraise_exception_forced.<locals>._force_reraise@   sU    "i(( "88: &a %AI& & &!"s#    A;	AA	 AAr   r+   r   r0   s     r   &test_save_and_reraise_exception_forcedz9SaveAndReraiseTest.test_save_and_reraise_exception_forced>   s    	" 	'>2r   c                 6    d }| j                  t        |       y )Nc                      	 t        d      # t        $ r3 t        j                         j	                         j                          Y y w xY w)Nr*   )r+   r,   r   r-   capturer/   r   r   r   r0   zZSaveAndReraiseTest.test_save_and_reraise_exception_capture_reraise.<locals>._force_reraiseL   sB    Pi(( P335==?MMOPs    9A	A	r1   r2   s     r   /test_save_and_reraise_exception_capture_reraisezBSaveAndReraiseTest.test_save_and_reraise_exception_capture_reraiseJ   s    	P 	'>2r   c                 p    t        j                         }| j                  t        |j                  d       y )NTcheck)r   r-   r   RuntimeErrorr6   r   r   s     r   2test_save_and_reraise_exception_capture_not_activezESaveAndReraiseTest.test_save_and_reraise_exception_capture_not_activeT   s)    //1,		>r   c                     t        j                         }| j                  t        |j                         t        j                         }|j                  d       | j                  t        |j                         y )NFr9   )r   r-   r   r;   r/   r6   r<   s     r   1test_save_and_reraise_exception_forced_not_activezDSaveAndReraiseTest.test_save_and_reraise_exception_forced_not_activeX   sT    //1,8//1				,8r   c                    d }d}	 	 t        |      # t         $ r. t        j                         5  	 d d d        n# 1 sw Y   nxY wY nw xY wn# t         $ r}|}Y d }~nd }~ww xY w| j                  t	        |      |       y )Nfoo)r,   r   r-   assertEqualstr)r   r   msg_es       r   test_save_and_reraise_exceptionz2SaveAndReraiseTest.test_save_and_reraise_exception_   s    	n$ 88:     	A	 	Q%s@    A	:	A	A	A	A A		A 	A"AA"zlogging.getLoggerc                 \    |       }d }d}	 	 t        d      # t         $ r/ t        j                         5  t        |      # 1 sw Y   nxY wY nw xY wn# t         $ r}|}Y d }~nd }~ww xY w| j                  t	        |      |       | j                  |j                  j                         y )Nsecond exceptiondropped)r,   r   r-   rB   rC   
assertTrueerrorcalledr   get_logger_mockloggerr   rD   rE   s         r   'test_save_and_reraise_exception_droppedz:SaveAndReraiseTest.test_save_and_reraise_exception_droppedm   s     " 	)	** )88: )#C.() ) ))) 	A	Q%++,s>    AAA	AA AA 	A*A%%A*c                     	 t        d      # t         $ r4 t        j                         5 }d|_        ddd       Y y# 1 sw Y   Y yxY ww xY w)z(Test that suppressing the reraise works.rA   FN)r,   r   r-   r.   )r   ctxts     r   *test_save_and_reraise_exception_no_reraisez=SaveAndReraiseTest.test_save_and_reraise_exception_no_reraise}   sK    	%E"" 	%446 %$$% % %	%s#    A
<A
A	A
A
c                 `    |       }d }d}	 	 t        d      # t         $ r1 t        j                  d      5  t        |      # 1 sw Y   nxY wY nw xY wn# t         $ r}|}Y d }~nd }~ww xY w| j                  t	        |      |       | j                  |j                  j                         y )NrH   rI   F)r.   )r,   r   r-   rB   rC   assertFalserK   rL   rM   s         r   2test_save_and_reraise_exception_dropped_no_reraisezESaveAndReraiseTest.test_save_and_reraise_exception_dropped_no_reraise   s     !" 	)	** )88G )#C.() ) ))) 	A	Q%,,-s>    AAA		AA AA 	A, A''A,c                 *   t        j                         }	 	 t        d      # t        $ r1 t        j                  |      5  t        d      # 1 sw Y   nxY wY nw xY wn# t        $ r Y nw xY w| j                  |j                  j                         y )NrA   )rO   rH   )r   	MagicMockr,   r   r-   rJ   rK   rL   )r   fake_loggers     r   /test_save_and_reraise_exception_provided_loggerzBSaveAndReraiseTest.test_save_and_reraise_exception_provided_logger   s    nn&	8&& 888L 8#$6778 8 888 		))001s9   " AAA	AA  AA   	A,+A,N)r
   r   r   r3   r7   r=   r?   rF   r   patchrP   rS   rV   rZ   r   r   r   r'   r'   <   se    
33?9& TZZ#$- %-% TZZ#$. %. 
2r   r'   c                       e Zd Z fdZej
                  d        Zej                  j                  e
d      ej                  j                  ed      d               Zej                  j                  e
d      ej                  j                  ed      d               Zej                  j                  e
d      ej                  j                  ed      d               Zej                  j                  e
d      ej                  j                  ed      d               Zej                  j                  e
d      ej                  j                  ed      d	               Zej                  j                  e
d      ej                  j                  ed      d
               Zej                  j                  e
d      ej                  j                  ed      d               Z xZS )"ForeverRetryUncaughtExceptionsTestc                     t         t        |           g | _        | j	                  t        j                  dd              y )Nz
time.sleep)return_value)superr]   setUp_exceptions
useFixturefixtures	MockPatch)r   	__class__s    r   ra   z(ForeverRetryUncaughtExceptionsTest.setUp   s2    0$=?**<dKLr   c                 R    | j                   r| j                   j                  d      y )Nr   )rb   pop)r   s    r   exception_generatorz6ForeverRetryUncaughtExceptionsTest.exception_generator   s'    ""&&q)) r   	exceptionnowc                    t        ddz        g| _        dg|_        | j                          | j	                  g | j                         |j                  ddz         |j                  t        j                         g       y )Nzunexpected %d   r   z5Unexpected exception occurred %d time(s)... retrying.)	r,   rb   side_effectri   rB   assert_called_once_withassert_has_callsr   callr   mock_nowmock_logs      r    test_exc_retrier_1exc_gives_1logzCForeverRetryUncaughtExceptionsTest.test_exc_retrier_1exc_gives_1log   s}    
 o)*
 !"s  "T--.((CaG	
 	!!IIK#
 	r   c                    t        d      g| _        dg}t        dd      D ]7  }| j                  j                  t        d             |j                  |       9 ||_        | j                          | j                  g | j                         | j                  dt        |j                               | j                  dt        |j                               |j                  t        j                  d      g       y )Nunexpected 1r         
   rm   4Unexpected exception occurred 1 time(s)... retrying.)r,   rb   rangeappendrn   ri   rB   len
mock_callsrp   r   rq   )r   rs   rt   mock_now_side_effectis        r   +test_exc_retrier_same_10exc_1min_gives_1logzNForeverRetryUncaughtExceptionsTest.test_exc_retrier_same_10exc_1min_gives_1log   s     n%
 !"s q" 	+A##In$=> !''*		+  4  "T--.S!4!456C 3 345!!IILM#
 	r   c                    t        d      t        d      g| _        g d|_        | j                          | j	                  g | j                         | j	                  dt        |j                               | j	                  dt        |j                               |j                  t        j                  d      t        j                  d      g       y )Nrw   )r   A   r   B      rx   r{   )
r,   rb   rn   ri   rB   r~   r   rp   r   rq   rr   s      r   +test_exc_retrier_same_2exc_2min_gives_2logszNForeverRetryUncaughtExceptionsTest.test_exc_retrier_same_2exc_2min_gives_2logs   s     n%n%

 
 	  "T--.C 3 345C 3 345!!IILMIILM#
 	r   c                 "   t        d      g| _        dg}dD ]7  }| j                  j                  t        d             |j                  |       9 | j                  j                  t        d             |j                  d       dD ]  }|j                  |        dD ]7  }| j                  j                  t        d             |j                  |       9 ||_        | j	                          | j                  g | j                         | j                  dt        |j                               | j                  dt        |j                               |j                  t        j                  d	      t        j                  d
      g       y )Nrw   r   )      "   -   j   )r   k   )u            r   rx   r{   z4Unexpected exception occurred 5 time(s)... retrying.)r,   rb   r}   rn   ri   rB   r~   r   rp   r   rq   )r   rs   rt   r   tss        r   ,test_exc_retrier_same_10exc_2min_gives_2logszOForeverRetryUncaughtExceptionsTest.test_exc_retrier_same_10exc_2min_gives_2logs   sn    n%
  
 # 	,B##In$=> !''+		, 		. 9:##C( 	,B !''+	, ' 	,B##In$=> !''+		,  4  "T--.S!4!456C 3 345!!IILMIILM#
 	r   c                    t        d      g| _        dg}| j                  j                  t        d             |j                  d       | j                  j                  t        d             |j                  ddg       | j                  j                  t        d             |j                  d       ||_        | j                          | j                  g | j                         | j                  dt        |j                               | j                  dt        |j                               |j                  t        j                  d	      t        j                  d	      g       y )
Nrw   r      unexpected 2rz         rx   r{   r,   rb   r}   extendrn   ri   rB   r~   r   rp   r   rq   r   rs   rt   r   s       r   ,test_exc_retrier_mixed_4exc_1min_gives_2logszOForeverRetryUncaughtExceptionsTest.test_exc_retrier_mixed_4exc_1min_gives_2logs2  s.    n%

 !"s 		. 9:
 	##A&	. 9: 	##RH-	. 9: 	##B'3  "T--.C 3 345C 3 345!!IILMIILM#
 	r   c                    t        d      g| _        dg}| j                  j                  t        d             |j                  d       | j                  j                  t        d             |j                  ddg       | j                  j                  t        d             |j                  d       ||_        | j                          | j                  g | j                         | j                  dt        |j                               | j                  d	t        |j                               |j                  t        j                  d
      t        j                  d
      g       y )Nrw   r   rz   r   d   i   n   r   rx   r{   r   r   s       r   ,test_exc_retrier_mixed_4exc_2min_gives_2logszOForeverRetryUncaughtExceptionsTest.test_exc_retrier_mixed_4exc_2min_gives_2logs_  s*   
 n%
 !"s
 		. 9:##B'
 		. 9:##S#J/	. 9:##C(3  "T--.C 3 345C 3 345!!IILMIILM#
 	r   c                    t        d      g| _        dg}| j                  j                  t        d             |j                  d       | j                  j                  t        d             |j                  g d       | j                  j                  t        d             |j                  ddg       ||_        | j                          | j                  g | j                         | j                  dt        |j                               | j                  d	t        |j                               |j                  t        j                  d
      t        j                  d      t        j                  d
      g       y )Nrw   r   rz   )r   r   r   r   r   o         r{   z4Unexpected exception occurred 2 time(s)... retrying.r   r   s       r   ,test_exc_retrier_mixed_4exc_2min_gives_3logszOForeverRetryUncaughtExceptionsTest.test_exc_retrier_mixed_4exc_2min_gives_3logs  s5    n%
 !"s
 		. 9:##B'	. 9:##O4	. 9:##S#J/3  "T--.C 3 345C 3 345!!IILMIILMIILM#
 	r   )r
   r   r   ra   r   !forever_retry_uncaught_exceptionsri   r   r[   objectloggingr   ru   r   r   r   r   r   r   __classcell__)rf   s   @r   r]   r]      s   M //* 0* 
ZZw,	ZZy%( ) -$ 
ZZw,	ZZy%( ) -4 
ZZw,	ZZy%( ) -: 
ZZw,	ZZy%(. ) -.` 
ZZw,	ZZy%() ) -)V 
ZZw,	ZZy%($ ) -$L 
ZZw,	ZZy%(! ) -!r   r]   c                       e Zd ZefdZefdZefdZefdZd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!y) ExceptionFilterTestc                 8    t         j                  fd       }|S )Nc                     t        |       S )Ignore some exceptions F.
isinstanceexignore_classess    r   ignore_exceptionsz@ExceptionFilterTest._make_filter_func.<locals>.ignore_exceptions  s     b.11r   r   exception_filter)r   r   r   s    ` r   _make_filter_funcz%ExceptionFilterTest._make_filter_func  s#    		"	"	2 
#	2 ! r   c                 D     G d dt               } ||      j                  S )Nc                   6    e Zd Zd Zej
                  d        Zy)AExceptionFilterTest._make_filter_method.<locals>.ExceptionIgnorerc                     || _         y N)ignore)r   r   s     r   __init__zJExceptionFilterTest._make_filter_method.<locals>.ExceptionIgnorer.__init__  s	    $r   c                 .    t        || j                        S )Ignore some exceptions M.r   r   )r   r   s     r   r   zSExceptionFilterTest._make_filter_method.<locals>.ExceptionIgnorer.ignore_exceptions  s     ""dkk22r   N)r
   r   r   r   r   r   r   r   r   r   ExceptionIgnorerr     s!    % &&3 '3r   r   r   r   r   r   r   s      r   _make_filter_methodz'ExceptionFilterTest._make_filter_method  s!    	3v 	3  /AAAr   c                 >     G fddt               }|j                  S )Nc                   B    e Zd ZW  Zej
                  ed               Zy)FExceptionFilterTest._make_filter_classmethod.<locals>.ExceptionIgnorerc                 .    t        || j                        S )Ignore some exceptions C.r   )clsr   s     r   r   zXExceptionFilterTest._make_filter_classmethod.<locals>.ExceptionIgnorer.ignore_exceptions  s     ""cjj11r   N)r
   r   r   r   r   r   classmethodr   r   s   r   r   r     s(    #F&&2  '2r   r   r   r   s    ` r   _make_filter_classmethodz,ExceptionFilterTest._make_filter_classmethod  s    	2v 	2  111r   c                 >     G fddt               }|j                  S )Nc                   @    e Zd Zej                  e fd              Zy)GExceptionFilterTest._make_filter_staticmethod.<locals>.ExceptionIgnorerc                     t        |       S )Ignore some exceptions S.r   r   s    r   r   zYExceptionFilterTest._make_filter_staticmethod.<locals>.ExceptionIgnorer.ignore_exceptions  s     ""n55r   N)r
   r   r   r   r   staticmethodr   r   s   r   r   r     s#    &&6  '6r   r   r   r   s    ` r   _make_filter_staticmethodz-ExceptionFilterTest._make_filter_staticmethod  s    	6v 	6  111r   c                 n    | j                         }	 J d       # t        $ r} ||       Y d }~y d }~ww xY wNThis is a test)r   r,   r   ignore_assertion_errorexcs      r   test_filter_func_callz)ExceptionFilterTest.test_filter_func_call  s<    !%!7!7!9	(***5 	("3''	(    	4/4c                     | j                         }	 t        # t        $ r!}| j                  t        ||       Y d }~y d }~ww xY wr   r   r;   r,   r   r   s      r   test_raise_func_callz(ExceptionFilterTest.test_raise_func_call  sE    !%!7!7!9	I 	Il,BCHH	I    	A=Ac                    | j                         }	 t        # t        $ rb}	 t        # t        $ r}| j                  ||       Y d }~nd }~ww xY w| j	                  t        ||      }| j                  ||       Y d }~y d }~ww xY wr   )r   r;   r,   assertIsNotr   assertIs)r   r   exc1exc2raiseds        r   test_raise_previous_func_callz1ExceptionFilterTest.test_raise_previous_func_call  s    !%!7!7!9
	( 	(-"" -  t,,-&&|'='+-F MM$''	(s/    	B(	AAA>A,A>>Bc                     | j                         }	 t        # t        $ r8}	 J d       # t        $ r Y nw xY w| j                  t        ||       Y d }~y d }~ww xY wr   r   )r   r   r   s      r   ,test_raise_previous_after_filtered_func_callz@ExceptionFilterTest.test_raise_previous_after_filtered_func_call  sg    !%!7!7!9	J 	J...u l,BDII	Js%    	A)	5A5AAc                     t         j                  d        }	 J d       # t        $ r!}| j                  t        ||       Y d }~y d }~ww xY w)Nc                     t         r   r;   r   s    r   translate_exceptionszLExceptionFilterTest.test_raise_other_func_call.<locals>.translate_exceptions      r   r   )r   r   r,   r   r;   )r   r   r   s      r   test_raise_other_func_callz.ExceptionFilterTest.test_raise_other_func_call  sS    		"	"	 
#		G***5 	Gl,@#FF	Gs    	A	AA	c                 N    | j                         }|5  J d       # 1 sw Y   y xY wr   r   r   r   s     r    test_filter_func_context_managerz4ExceptionFilterTest.test_filter_func_context_manager  s/    !%!7!7!9# 	+***5	+ 	+   $c                 \    | j                         fd}| j                  t        |       y )Nc                  .     5  t         # 1 sw Y   y xY wr   r   r   s   r   try_runtime_errzLExceptionFilterTest.test_raise_func_context_manager.<locals>.try_runtime_err      ' #""# #   )r   r   r;   r   r   r   s     @r   test_raise_func_context_managerz3ExceptionFilterTest.test_raise_func_context_manager  s)    !%!7!7!9	# 	,8r   c                 h    t         j                  d        fd}| j                  t        |       y )Nc                     t         r   r   r   s    r   r   zWExceptionFilterTest.test_raise_other_func_context_manager.<locals>.translate_exceptions  r   r   c                  0     5  J d       # 1 sw Y   y xY wr   r   )r   s   r   try_assertionzPExceptionFilterTest.test_raise_other_func_context_manager.<locals>.try_assertion"  s!    % /...u/ /s   )r   r   r   r;   )r   r  r   s     @r   %test_raise_other_func_context_managerz9ExceptionFilterTest.test_raise_other_func_context_manager  s2    		"	"	 
#		/ 	,6r   c                 T    | j                         }|5  	 d d d        y # 1 sw Y   y xY wr   r   r   s     r   test_noexc_func_context_managerz3ExceptionFilterTest.test_noexc_func_context_manager(  s,    !%!7!7!9# 		 	 	s   'c                 `    t         j                  d        }|5  	 d d d        y # 1 sw Y   y xY w)Nc                     t         r   r   r   s    r   r   zXExceptionFilterTest.test_noexc_nocall_func_context_manager.<locals>.translate_exceptions/  r   r   r   )r   r   s     r   &test_noexc_nocall_func_context_managerz:ExceptionFilterTest.test_noexc_nocall_func_context_manager.  s7    		"	"	 
#	 " 		 	 	s   $-c                 \    | j                         }| j                  d|j                         y )Nr   )r   rB   __doc__r   ignore_funcs     r   test_func_docstringz'ExceptionFilterTest.test_func_docstring6  s'    ,,.4k6I6IJr   c                 n    | j                         }	 J d       # t        $ r} ||       Y d }~y d }~ww xY wr   )r   r,   r   s      r   test_filter_method_callz+ExceptionFilterTest.test_filter_method_call:  s<    !%!9!9!;	(***5 	("3''	(r   c                     | j                         }	 t        # t        $ r!}| j                  t        ||       Y d }~y d }~ww xY wr   )r   r;   r,   r   r   s      r   test_raise_method_callz*ExceptionFilterTest.test_raise_method_callB  sE    !%!9!9!;	I 	Il,BCHH	Ir   c                 N    | j                         }|5  J d       # 1 sw Y   y xY wr   )r   r   s     r   "test_filter_method_context_managerz6ExceptionFilterTest.test_filter_method_context_managerJ  s/    !%!9!9!;# 	+***5	+ 	+r   c                 \    | j                         fd}| j                  t        |       y )Nc                  .     5  t         # 1 sw Y   y xY wr   r   r   s   r   r   zNExceptionFilterTest.test_raise_method_context_manager.<locals>.try_runtime_errS  r   r   )r   r   r;   r   s     @r   !test_raise_method_context_managerz5ExceptionFilterTest.test_raise_method_context_managerP  s)    !%!9!9!;	# 	,8r   c                 \    | j                         }| j                  d|j                         y )Nr   )r   rB   r  r  s     r   test_method_docstringz)ExceptionFilterTest.test_method_docstringY  s'    ..04k6I6IJr   c                 n    | j                         }	 J d       # t        $ r} ||       Y d }~y d }~ww xY wr   )r   r,   r   s      r   test_filter_classmethod_callz0ExceptionFilterTest.test_filter_classmethod_call]  s<    !%!>!>!@	(***5 	("3''	(r   c                     | j                         }	 t        # t        $ r!}| j                  t        ||       Y d }~y d }~ww xY wr   )r   r;   r,   r   r   s      r   test_raise_classmethod_callz/ExceptionFilterTest.test_raise_classmethod_calle  sE    !%!>!>!@	I 	Il,BCHH	Ir   c                 N    | j                         }|5  J d       # 1 sw Y   y xY wr   )r   r   s     r   'test_filter_classmethod_context_managerz;ExceptionFilterTest.test_filter_classmethod_context_managerm  s/    !%!>!>!@# 	+***5	+ 	+r   c                 \    | j                         fd}| j                  t        |       y )Nc                  .     5  t         # 1 sw Y   y xY wr   r   r   s   r   r   zSExceptionFilterTest.test_raise_classmethod_context_manager.<locals>.try_runtime_errv  r   r   )r   r   r;   r   s     @r   &test_raise_classmethod_context_managerz:ExceptionFilterTest.test_raise_classmethod_context_managers  s)    !%!>!>!@	# 	,8r   c                 \    | j                         }| j                  d|j                         y )Nr   )r   rB   r  r  s     r   test_classmethod_docstringz.ExceptionFilterTest.test_classmethod_docstring|  s'    3354k6I6IJr   c                 n    | j                         }	 J d       # t        $ r} ||       Y d }~y d }~ww xY wr   )r   r,   r   s      r   test_filter_staticmethod_callz1ExceptionFilterTest.test_filter_staticmethod_call  s<    !%!?!?!A	(***5 	("3''	(r   c                     | j                         }	 t        # t        $ r!}| j                  t        ||       Y d }~y d }~ww xY wr   )r   r;   r,   r   r   s      r   test_raise_staticmethod_callz0ExceptionFilterTest.test_raise_staticmethod_call  sE    !%!?!?!A	I 	Il,BCHH	Ir   c                 N    | j                         }|5  J d       # 1 sw Y   y xY wr   )r   r   s     r   (test_filter_staticmethod_context_managerz<ExceptionFilterTest.test_filter_staticmethod_context_manager  s/    !%!?!?!A# 	+***5	+ 	+r   c                 \    | j                         fd}| j                  t        |       y )Nc                  .     5  t         # 1 sw Y   y xY wr   r   r   s   r   r   zTExceptionFilterTest.test_raise_staticmethod_context_manager.<locals>.try_runtime_err  r   r   )r   r   r;   r   s     @r   'test_raise_staticmethod_context_managerz;ExceptionFilterTest.test_raise_staticmethod_context_manager  s)    !%!?!?!A	# 	,8r   c                 \    | j                         }| j                  d|j                         y )Nr   )r   rB   r  r  s     r   test_staticmethod_docstringz/ExceptionFilterTest.test_staticmethod_docstring  s'    4464k6I6IJr   N)"r
   r   r   AssertionErrorr   r   r   r   r   r   r   r   r   r   r   r  r  r
  r  r  r  r  r  r  r  r  r   r#  r%  r'  r)  r+  r.  r0  r   r   r   r   r     s    /= ! 2@ 
B 7E 
2 8F 2(I(
JG+9	7K(I+9K(I+9K(I+9Kr   r   )r   unittestr   rd   oslotestr   	test_base
oslo_utilsr   r   CausedByExceptionr   r   BaseTestCaser   r'   r]   r   r   r   r   <module>r8     s       &   	H&& 		H&& 	$9)) $6d2// d2NG)?)? GTtK)00 tKr   