Home | History | Annotate | Download | only in unittest2

Lines Matching full:path

15     from os.path import relpath
192 top_level_dir = os.path.abspath(top_level_dir)
194 if not top_level_dir in sys.path:
197 # in sys.path to minimise likelihood of conflicts between installed
199 sys.path.insert(0, top_level_dir)
203 if os.path.isdir(os.path.abspath(start_dir)):
204 start_dir = os.path.abspath(start_dir)
206 is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
216 start_dir = os.path.abspath(os.path.dirname((the_module.__file__)))
218 self._top_level_dir = os.path.abspath(os.path.dirname(os.path.dirname(sys.modules[top_part].__file__)))
219 sys.path.remove(top_level_dir)
227 def _get_name_from_path(self, path):
228 path = os.path.splitext(os.path.normpath(path))[0]
230 _relpath = relpath(path, self._top_level_dir)
231 assert not os.path.isabs(_relpath), "Path must be within the project"
232 assert not _relpath.startswith('..'), "Path must be within the project"
234 name = _relpath.replace(os.path.sep, '.')
241 def _match_path(self, path, full_path, pattern):
243 return fnmatch(path, pattern)
249 for path in paths:
250 full_path = os.path.join(start_dir, path)
251 if os.path.isfile(full_path):
252 if not VALID_MODULE_NAME.match(path):
255 if not self._match_path(path, full_path, pattern):
264 mod_file = os.path.abspath(getattr(module, '__file__', full_path))
265 realpath = os.path.splitext(mod_file)[0]
266 fullpath_noext = os.path.splitext(full_path)[0]
268 module_dir = os.path.dirname(realpath)
269 mod_name = os.path.splitext(os.path.basename(full_path))[0]
270 expected_dir = os.path.dirname(full_path)
275 elif os.path.isdir(full_path):
276 if not os.path.isfile(os.path.join(full_path, '__init__.py')):
281 if fnmatch(path, pattern):