Changeset 36
- Timestamp:
- 03/14/2008 06:40:29 PM (10 months ago)
- Files:
-
- 1 modified
-
trunk/functest/collector.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/functest/collector.py
r29 r36 32 32 module = imp.load_module(name, filename, pathname, description) 33 33 module.functest_module_path = path 34 module.__file__ = os.path.abspath(path) 34 35 sys.path.pop(0) 35 36 elif os.path.isdir(path): … … 41 42 module = imp.load_module(name, filename, pathname, description) 42 43 module.functest_module_path = path 44 module.__file__ = os.path.abspath(path+'.__init__.py') 43 45 sys.path.pop(0) 44 46 else: … … 58 60 while os.path.isfile(os.path.join(path, '__init__.py')): 59 61 module_chain.append(self.import_module(path)) 60 split = list(os.path.split(path)) 61 split.pop(-1) 62 path = os.path.join(*split) 62 path = os.path.join(*os.path.split(path)[-1]) 63 63 module_chain.reverse() 64 64 return module_chain … … 75 75 func(test_module) 76 76 for filename in [ f for f in os.listdir(path) if ( not f.startswith('.') ) and 77 ( f.startswith('test') ) and 77 78 ( ( f.endswith('.py') ) or 78 79 ( os.path.isdir(os.path.join(path, f)) and 79 os.path.isfile(os.path.join(path, f, '__init__.py')) ) 80 ) ]: 80 os.path.isfile(os.path.join(path, f, '__init__.py')) 81 ) 82 ) 83 ]: 81 84 setattr(test_module, filename.split('.')[0], self.create_test_module(os.path.join(path, filename))) 82 85 else:
