We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent baacf4d commit a24348cCopy full SHA for a24348c
Lib/test/test_module.py
@@ -191,8 +191,12 @@ def test_module_repr_builtin(self):
191
192
def test_module_repr_source(self):
193
r = repr(unittest)
194
- self.assertEqual(r[:25], "<module 'unittest' from '")
195
- self.assertEqual(r[-13:], "__init__.py'>")
+ starts_with = "<module 'unittest' from '"
+ ends_with = "__init__.py'>"
196
+ self.assertEqual(r[:len(starts_with)], starts_with,
197
+ '{!r} does not start with {!r}'.format(r, starts_with))
198
+ self.assertEqual(r[-len(ends_with):], ends_with,
199
+ '{!r} does not end with {!r}'.format(r, ends_with))
200
201
def test_module_finalization_at_shutdown(self):
202
# Module globals and builtins should still be available during shutdown
0 commit comments