From 0d891cba2c90b56cb11ee1b20ef3458acf86686c Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Wed, 1 May 2019 02:59:43 +0900 Subject: [PATCH] Temporary fix to assertRaises and assert_raises prints errors --- tests/snippets/testutils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/snippets/testutils.py b/tests/snippets/testutils.py index 7dda57b17..49b7fedc1 100644 --- a/tests/snippets/testutils.py +++ b/tests/snippets/testutils.py @@ -14,9 +14,9 @@ def assert_raises(exc_type, expr, msg=None): except exc_type: pass else: - failmsg = '{!s} was not raised'.format(exc_type.__name__) + failmsg = '{} was not raised'.format(exc_type.__name__) if msg is not None: - failmsg += ': {!s}'.format(msg) + failmsg += ': {}'.format(msg) assert False, failmsg @@ -29,8 +29,8 @@ class assertRaises: def __exit__(self, exc_type, exc_val, exc_tb): if exc_type is None: - failmsg = '{!s} was not raised'.format(self.expected.__name__) - assert False, failmsg + failmsg = '{} was not raised'.format(self.expected.__name__) + assert False, failmsg if not issubclass(exc_type, self.expected): return False return True