File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ def result(self) -> Any:
6161 except Exception as e :
6262 if len (e .args ) == 0 :
6363 raise e
64- msg = e .args [0 ]
64+
65+ msg = str (e .args [0 ])
6566 if "subject() got an unexpected keyword argument" in msg :
6667 raise TestError (
6768 "Subject received "
Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ def test_raises_test_error(self):
8282
8383
8484class TestAppend (TestCase ):
85-
8685 def instance (self ) -> TestClass :
8786 return TestClass ()
8887
@@ -204,3 +203,11 @@ def subject(self):
204203
205204 def test_reraises_empty_exception (self ):
206205 self .assertResultRaises (self .MyError )
206+
207+
208+ class TestRaiseExceptionWithNonStrArgs (TestCase ):
209+ def subject (self ):
210+ raise KeyError (2 )
211+
212+ def test_reraises_error (self ):
213+ self .assertResultRaises (KeyError )
You can’t perform that action at this time.
0 commit comments