diff options
author | Jason Madden <jamadden@gmail.com> | 2018-09-28 11:25:11 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2018-09-28 11:25:11 -0500 |
commit | 1c300ede17e760731f4e25d3153b5afaa0eadd1d (patch) | |
tree | 67dc48b01dbf15ac2b6ef86a79eefde100186f54 | |
parent | 268cb192ce7dc3fbbe375bca7f8a62b9af4ac2d6 (diff) | |
download | zope-configuration-1c300ede17e760731f4e25d3153b5afaa0eadd1d.tar.gz |
Also test the repr of ConfigurationError.issue43
-rw-r--r-- | src/zope/configuration/tests/test_config.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/zope/configuration/tests/test_config.py b/src/zope/configuration/tests/test_config.py index f8bebe7..ab21589 100644 --- a/src/zope/configuration/tests/test_config.py +++ b/src/zope/configuration/tests/test_config.py @@ -1823,13 +1823,14 @@ class Test_toargs(unittest.TestCase): self.assertEqual(exc.exception.args, ("Invalid value for 'count'",)) - exception_str = str(exc.exception) - self.assertTrue(exception_str.startswith( - "Invalid value for 'count'\n" - ), exception_str) - self.assertTrue(exception_str.endswith( - "TooSmall: (-1, 0)" - ), exception_str) + for meth in str, repr: + exception_str = meth(exc.exception) + self.assertIn( + "Invalid value for", + exception_str) + self.assertIn( + "TooSmall: (-1, 0)", + exception_str) class Test_expand_action(unittest.TestCase): |