Lines Matching refs:start_dir
145 def discover(self, start_dir, pattern='test*.py', top_level_dir=None): argument
172 top_level_dir = start_dir
185 if os.path.isdir(os.path.abspath(start_dir)):
186 start_dir = os.path.abspath(start_dir)
187 if start_dir != top_level_dir:
188 is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
192 __import__(start_dir)
196 the_module = sys.modules[start_dir]
197 top_part = start_dir.split('.')[0]
198 start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
204 raise ImportError('Start directory is not importable: %r' % start_dir)
206 tests = list(self._find_tests(start_dir, pattern))
239 def _find_tests(self, start_dir, pattern): argument
241 paths = os.listdir(start_dir)
244 full_path = os.path.join(start_dir, path)