Commit 69082ad3 authored by Brett Cannon's avatar Brett Cannon

Make a test easier to read.

parent 3bda4e51
...@@ -251,13 +251,12 @@ class LongReprTest(unittest.TestCase): ...@@ -251,13 +251,12 @@ class LongReprTest(unittest.TestCase):
def test_module(self): def test_module(self):
self._check_path_limitations(self.pkgname) self._check_path_limitations(self.pkgname)
eq = self.assertEqual
create_empty_file(os.path.join(self.subpkgname, self.pkgname + '.py')) create_empty_file(os.path.join(self.subpkgname, self.pkgname + '.py'))
importlib.invalidate_caches() importlib.invalidate_caches()
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
eq(repr(areallylongpackageandmodulenametotestreprtruncation), module = areallylongpackageandmodulenametotestreprtruncation
"<module %r from %r>" % (areallylongpackageandmodulenametotestreprtruncation.__name__, areallylongpackageandmodulenametotestreprtruncation.__file__)) self.assertEqual(repr(module), "<module %r from %r>" % (module.__name__, module.__file__))
eq(repr(sys), "<module 'sys' (built-in)>") self.assertEqual(repr(sys), "<module 'sys' (built-in)>")
def test_type(self): def test_type(self):
self._check_path_limitations('foo') self._check_path_limitations('foo')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment