示例#1
0
 def _context(self):
     try:
         return self.test.context
     except AttributeError:
         pass
     try:
         return self.test.__class__
     except AttributeError:
         pass
     try:
         return resolve_name(self.test.__module__)
     except AttributeError:
         pass
     return None
示例#2
0
 def _context(self):
     try:
         return self.test.context
     except AttributeError:
         pass
     try:
         return self.test.__class__
     except AttributeError:
         pass
     try:
         return resolve_name(self.test.__module__)
     except AttributeError:
         pass
     return None
示例#3
0
 def ancestry(self, context):
     """Return the ancestry of the context
     """
     if context is None:
         return
     if hasattr(context, 'im_class'):
         context = context.im_class
     if hasattr(context, '__module__'):
         ancestors = context.__module__.split('.')
     elif hasattr(context, '__name__'):
         ancestors = context.__name__.split('.')[:-1]
     else:
         raise TypeError("%s has no ancestors?" % context)
     while ancestors:
         yield resolve_name('.'.join(ancestors))
         ancestors.pop()
示例#4
0
 def ancestry(self, context):
     """Return the ancestry of the context
     """
     if context is None:
         return
     if hasattr(context, 'im_class'):
         context = context.im_class
     if hasattr(context, '__module__'):
         ancestors = context.__module__.split('.')
     elif hasattr(context, '__name__'):
         ancestors = context.__name__.split('.')[:-1]
     else:
         raise TypeError("%s has no ancestors?" % context)
     while ancestors:
         yield resolve_name('.'.join(ancestors))
         ancestors.pop()
示例#5
0
 def _context(self):
     return resolve_name(self.test.__module__)
示例#6
0
 def _context(self):
     return resolve_name(self.test.__module__)