mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Make a test easier to read.
This commit is contained in:
parent
839a482a11
commit
7b383c431a
1 changed files with 3 additions and 4 deletions
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue