diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index 14cf181eed67..47ec07c0595f 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -194,7 +194,7 @@ def test_module(self): touch(os.path.join(self.subpkgname, self.pkgname + os.extsep + 'py')) from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation eq(repr(areallylongpackageandmodulenametotestreprtruncation), - "" % areallylongpackageandmodulenametotestreprtruncation.__file__) + "" % (areallylongpackageandmodulenametotestreprtruncation.__name__, areallylongpackageandmodulenametotestreprtruncation.__file__)) eq(repr(sys), "") def test_type(self): @@ -205,7 +205,7 @@ class foo(object): ''') from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo eq(repr(foo.foo), - "") + "" % foo.__name__) def test_object(self): # XXX Test the repr of a type with a really long tp_name but with no @@ -218,8 +218,9 @@ class bar: pass ''') from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar + # Module name may be prefixed with "test.", depending on how run. self.failUnless(repr(bar.bar).startswith( - "