]> granicus.if.org Git - python/commitdiff
Skip over any file or folder that starts with a dot (e.g. .svn).
authorBrett Cannon <bcannon@gmail.com>
Sun, 18 Jan 2009 00:36:22 +0000 (00:36 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 18 Jan 2009 00:36:22 +0000 (00:36 +0000)
Lib/importlib/test/__init__.py

index 64927073354d6cbd5b8f7a34f89f000885f5f375..f130d9f31956012d60fda80b8abaab46af506638 100644 (file)
@@ -6,6 +6,8 @@ import unittest
 def test_suite(package=__package__, directory=os.path.dirname(__file__)):
     suite = unittest.TestSuite()
     for name in os.listdir(directory):
+        if name.startswith('.'):
+            continue
         path = os.path.join(directory, name)
         if os.path.isfile(path) and name.startswith('test_'):
             submodule_name = os.path.splitext(name)[0]
@@ -15,6 +17,7 @@ def test_suite(package=__package__, directory=os.path.dirname(__file__)):
             suite.addTest(module_tests)
         elif os.path.isdir(path):
             package_name = "{0}.{1}".format(package, name)
+            print(package_name)
             __import__(package_name, level=0)
             package_tests = getattr(sys.modules[package_name], 'test_suite')()
             suite.addTest(package_tests)