From b95ae91b113867264d42081549c09931cce00d4f Mon Sep 17 00:00:00 2001 From: Ray Holder Date: Sun, 4 May 2014 20:37:32 -0500 Subject: add a crude check for a custom exception message in the test suite --- test_retrying.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test_retrying.py b/test_retrying.py index a1aac6f..b5f7ed6 100644 --- a/test_retrying.py +++ b/test_retrying.py @@ -193,7 +193,8 @@ class NoCustomErrorAfterCount: """ if self.counter < self.count: self.counter += 1 - raise CustomError("This is a Custom exception class") + derived_message = "This is a Custom exception class" + raise CustomError(derived_message) return True def retry_if_result_none(result): @@ -370,6 +371,8 @@ class TestDecoratorWrapper(unittest.TestCase): self.assertTrue(re.last_attempt.value[0] is not None) self.assertTrue(isinstance(re.last_attempt.value[1], CustomError)) self.assertTrue(re.last_attempt.value[2] is not None) + + self.assertTrue("This is a Custom exception class" in str(re.last_attempt.value[1])) print(re) def test_defaults(self): -- cgit v1.2.1