File tree 2 files changed +13
-0
lines changed
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:
59
59
self ._subjectResult = self .subject (** self ._subjectKwargs )
60
60
return self ._subjectResult
61
61
except Exception as e :
62
+ if len (e .args ) == 0 :
63
+ raise e
62
64
msg = e .args [0 ]
63
65
if "subject() got an unexpected keyword argument" in msg :
64
66
raise TestError (
Original file line number Diff line number Diff line change @@ -193,3 +193,14 @@ def test_mutate_cached_result(self):
193
193
self .assertResult ([1 , 2 ])
194
194
self .cachedResult ().append (3 )
195
195
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