Rip the import repr truncation test out of here and put it in test_repr.py
authorBarry Warsaw <barry@python.org>
Fri, 24 Aug 2001 18:38:02 +0000 (18:38 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 24 Aug 2001 18:38:02 +0000 (18:38 +0000)
Lib/test/test_import.py

index e2fbc5c022c0727ff0c203a7c00d341dd7868edd..b2e3fb6d3d46585768bd73367543019b414a1b07 100644 (file)
@@ -69,38 +69,3 @@ try:
             test_with_extension(ext)
 finally:
     del sys.path[0]
-
-def touch(path):
-    fp = open(path, 'w')
-    fp.close()
-
-# test imports of packages with really long names, but specifically that their
-# reprs include the full name
-try:
-    longname = 'areallylongpackageandmodulenametotestreprtruncation'
-    os.mkdir(longname)
-    touch(os.path.join(longname, '__init__.py'))
-    os.mkdir(os.path.join(longname, longname))
-    touch(os.path.join(longname, longname, '__init__.py'))
-    touch(os.path.join(longname, longname, longname + '.py'))
-    sys.path.insert(0, os.getcwd())
-    from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
-    if `areallylongpackageandmodulenametotestreprtruncation` <> \
-       "<module 'areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation' from '%s'>" % areallylongpackageandmodulenametotestreprtruncation.__file__:
-        raise TestFailed, 'module name truncation'
-finally:
-    # Delete recursively
-    del sys.path[0]
-    def zap(actions, dirname, names):
-        for name in names:
-            actions.append(os.path.join(dirname, name))
-    actions = []
-    os.path.walk(longname, zap, actions)
-    actions.append(longname)
-    actions.sort()
-    actions.reverse()
-    for p in actions:
-        if os.path.isdir(p):
-            os.rmdir(p)
-        else:
-            os.remove(p)