File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,16 @@ async def bar():
146146
147147
148148class  ErrorsHelper :
149+     @property  
150+     def  raise_baseexception (self ):
151+         raise  BaseException ("base exception should be raised" )
152+ 
149153    @property  
150154    def  raise_exception (self ):
151155        raise  Exception ("exception should be catched" )
152156
153157    @property  
154-     def  raise_fail (self ):
158+     def  raise_fail_outcome (self ):
155159        pytest .fail ("fail should be catched" )
156160
157161
@@ -160,13 +164,15 @@ def test_helper_failures():
160164    with  pytest .raises (Exception ):
161165        helper .raise_exception 
162166    with  pytest .raises (OutcomeException ):
163-         helper .raise_fail 
167+         helper .raise_fail_outcome 
164168
165169
166170def  test_safe_getattr ():
167171    helper  =  ErrorsHelper ()
168172    assert  safe_getattr (helper , "raise_exception" , "default" ) ==  "default" 
169-     assert  safe_getattr (helper , "raise_fail" , "default" ) ==  "default" 
173+     assert  safe_getattr (helper , "raise_fail_outcome" , "default" ) ==  "default" 
174+     with  pytest .raises (BaseException ):
175+         assert  safe_getattr (helper , "raise_baseexception" , "default" )
170176
171177
172178def  test_safe_isclass ():
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments