summaryrefslogtreecommitdiff
path: root/test_retrying.py
diff options
context:
space:
mode:
authorRay Holder <ray@blacklocus.com>2014-05-04 20:37:32 -0500
committerRay Holder <ray@blacklocus.com>2014-05-04 20:37:32 -0500
commitb95ae91b113867264d42081549c09931cce00d4f (patch)
tree403871ec906c3586b38ca89a1fdd6739d01516cc /test_retrying.py
parent389d407f9d8faf55917627b77037b003f3a8b4d0 (diff)
downloadretrying-b95ae91b113867264d42081549c09931cce00d4f.tar.gz
add a crude check for a custom exception message in the test suite
Diffstat (limited to 'test_retrying.py')
-rw-r--r--test_retrying.py5
1 files changed, 4 insertions, 1 deletions
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):