Skip to content

Commit

Permalink
Use self.failureException.
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Mar 9, 2021
1 parent d3c0abf commit b871060
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/twisted/trial/test/test_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ def test_successResultOfWithFailureHasTraceback(self):
exception = Exception("Bad times")
try:
self.successResultOf(self.raisesException(exception))
except unittest.FailTest as e:
except self.failureException as e:
self.assertIn("Success result expected on", str(e))
self.assertIn("builtins.Exception: Bad times", str(e))

Expand Down Expand Up @@ -1301,7 +1301,7 @@ def test_failureResultOfWithWrongExceptionOneExpectedExceptionHasTB(self):
exception = Exception("Bad times")
try:
self.failureResultOf(self.raisesException(exception), KeyError)
except unittest.FailTest as e:
except self.failureException as e:
self.assertIn("Failure of type (builtins.KeyError) expected on", str(e))
self.assertIn("builtins.Exception: Bad times", str(e))

Expand Down Expand Up @@ -1338,7 +1338,7 @@ def test_failureResultOfWithWrongExceptionMultiExpectedExceptionsHasTB(self):

try:
self.failureResultOf(self.raisesException(exception), KeyError, IOError)
except unittest.FailTest as e:
except self.failureException as e:
self.assertIn(
"Failure of type (builtins.KeyError or builtins.OSError) expected on",
str(e),
Expand Down

0 comments on commit b871060

Please sign in to comment.