diff options
author | Brett Cannon <brett@python.org> | 2013-11-22 18:22:22 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-11-22 18:22:22 (GMT) |
commit | a24348cec112a2fd0b7c993981e2428e73f261d9 (patch) | |
tree | 4e4ccdcdadcdb0236e525a9d7458e9ed7dc622ae | |
parent | baacf4d29350b37470946a83b774f04c085ded98 (diff) | |
download | cpython-a24348cec112a2fd0b7c993981e2428e73f261d9.zip cpython-a24348cec112a2fd0b7c993981e2428e73f261d9.tar.gz cpython-a24348cec112a2fd0b7c993981e2428e73f261d9.tar.bz2 |
Make some tests more verbose in the face of failure
-rw-r--r-- | Lib/test/test_module.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py index 536f7cf..1230293 100644 --- a/Lib/test/test_module.py +++ b/Lib/test/test_module.py @@ -191,8 +191,12 @@ a = A(destroyed)""" def test_module_repr_source(self): r = repr(unittest) - self.assertEqual(r[:25], "<module 'unittest' from '") - self.assertEqual(r[-13:], "__init__.py'>") + starts_with = "<module 'unittest' from '" + ends_with = "__init__.py'>" + self.assertEqual(r[:len(starts_with)], starts_with, + '{!r} does not start with {!r}'.format(r, starts_with)) + self.assertEqual(r[-len(ends_with):], ends_with, + '{!r} does not end with {!r}'.format(r, ends_with)) def test_module_finalization_at_shutdown(self): # Module globals and builtins should still be available during shutdown |