File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,8 @@ def result(self) -> Any:
5959 self ._subjectResult = self .subject (** self ._subjectKwargs )
6060 return self ._subjectResult
6161 except Exception as e :
62+ if len (e .args ) == 0 :
63+ raise e
6264 msg = e .args [0 ]
6365 if "subject() got an unexpected keyword argument" in msg :
6466 raise TestError (
Original file line number Diff line number Diff line change @@ -193,3 +193,14 @@ def test_mutate_cached_result(self):
193193 self .assertResult ([1 , 2 ])
194194 self .cachedResult ().append (3 )
195195 self .assertListEqual (self .cachedResult (), [1 , 2 ])
196+
197+
198+ class TestRaiseEmptyException (TestCase ):
199+ class MyError (Exception ):
200+ pass
201+
202+ def subject (self ):
203+ raise self .MyError () # exception should be empty, i.e. no args
204+
205+ def test_reraises_empty_exception (self ):
206+ self .assertResultRaises (self .MyError )
You can’t perform that action at this time.
0 commit comments