attempt to fix module import using a namespace py33
authorrobin
Tue, 15 Oct 2013 14:45:50 +0100
branchpy33
changeset 3780 b809eb915503
parent 3779 47bb4a41365d
child 3781 df8b57380768
attempt to fix module import using a namespace
tests/runAll.py
--- a/tests/runAll.py	Tue Oct 15 14:44:54 2013 +0100
+++ b/tests/runAll.py	Tue Oct 15 14:45:50 2013 +0100
@@ -52,8 +52,9 @@
         modname = os.path.splitext(os.path.basename(filename))[0]
         if modname not in exclude:
             try:
-                exec('import %s as module' % modname)
-                allTests.addTest(module.makeSuite())
+                ns ={}
+                exec('import %s as module' % modname,ns)
+                allTests.addTest(ns['module'].makeSuite())
             except:
                 tt, tv, tb = sys.exc_info()[:]
                 nonImportable.append((filename,traceback.format_exception(tt,tv,tb)))
@@ -62,7 +63,6 @@
 
     return allTests
 
-
 def main(pattern='test_*.py'):
     try:
         folder = os.path.dirname(__file__)