]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make a test easier to read.
authorBrett Cannon <brett@python.org>
Mon, 11 Jun 2012 15:02:36 +0000 (11:02 -0400)
committerBrett Cannon <brett@python.org>
Mon, 11 Jun 2012 15:02:36 +0000 (11:02 -0400)
Lib/test/test_reprlib.py

index 1eee15fd95072bdd77ca59b8261c2cd4f3e94b9e..b5cc68096a491b6e20fd3bda64d2b22fe57bba1c 100644 (file)
@@ -251,13 +251,12 @@ class LongReprTest(unittest.TestCase):
 
     def test_module(self):
         self._check_path_limitations(self.pkgname)
-        eq = self.assertEqual
         create_empty_file(os.path.join(self.subpkgname, self.pkgname + '.py'))
         importlib.invalidate_caches()
         from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
-        eq(repr(areallylongpackageandmodulenametotestreprtruncation),
-           "<module %r from %r>" % (areallylongpackageandmodulenametotestreprtruncation.__name__, areallylongpackageandmodulenametotestreprtruncation.__file__))
-        eq(repr(sys), "<module 'sys' (built-in)>")
+        module = areallylongpackageandmodulenametotestreprtruncation
+        self.assertEqual(repr(module), "<module %r from %r>" % (module.__name__, module.__file__))
+        self.assertEqual(repr(sys), "<module 'sys' (built-in)>")
 
     def test_type(self):
         self._check_path_limitations('foo')