| 340 | return self.suiteClass(tests) |
| 341 | |
| 342 | def _get_directory_containing_module(self, module_name): |
| 343 | module = sys.modules[module_name] |
| 344 | full_path = os.path.abspath(module.__file__) |
| 345 | |
| 346 | if os.path.basename(full_path).lower().startswith('__init__.py'): |
| 347 | return os.path.dirname(os.path.dirname(full_path)) |
| 348 | else: |
| 349 | # here we have been given a module rather than a package - so |
| 350 | # all we can do is search the *same* directory the module is in |
| 351 | # should an exception be raised instead |
| 352 | return os.path.dirname(full_path) |
| 353 | |
| 354 | def _get_name_from_path(self, path): |
| 355 | if path == self._top_level_dir: |