pyt/path.py
def classes(self):
        """the partial self.class_name will be used to find actual TestCase classes"""
        for module in self.modules():
            cs = inspect.getmembers(module, inspect.isclass)
            class_name = getattr(self, 'class_name', '')
            class_regex = ''
            if class_name:
                if class_name.startswith("*"):
                    class_name = class_name.strip("*")
                    class_regex = re.compile(r'.*?{}'.format(class_name), re.I)
                else:
                    class_regex = re.compile(r'^{}'.format(class_name), re.I)

            for c_name, c in cs:
                can_yield = True
                if class_regex and not class_regex.match(c_name):
                #if class_name and class_name not in c_name:
                    can_yield = False

                if can_yield and issubclass(c, unittest.TestCase):
                    if c is not unittest.TestCase: # ignore actual TestCase class
                        logger.debug('class: {} matches {}'.format(c_name, class_name))
                        yield c
def classes(self):
        for module in self.modules():
            cs = inspect.getmembers(module, inspect.isclass)
            class_name = getattr(self, 'class_name', '')
            class_regex = ''
            if class_name:
                if class_name.startswith("*"):
                    class_name = class_name.strip("*")
                    class_regex = re.compile(r'.*?{}'.format(class_name), re.I)
                else:
                    class_regex = re.compile(r'^{}'.format(class_name), re.I)

            for c_name, c in cs:
                can_yield = True
                if class_regex and not class_regex.match(c_name):
                #if class_name and class_name not in c_name:
                    can_yield = False

                if can_yield and issubclass(c, unittest.TestCase):
                    if c is not unittest.TestCase: # ignore actual TestCase class
                        logger.debug('class: {} matches {}'.format(c_name, class_name))
                        yield c
def classes ( self ) : for module in self . modules ( ) : cs = inspect . getmembers ( module , inspect . isclass ) class_name = getattr ( self , 'class_name' , '' ) class_regex = '' if class_name : if class_name . startswith ( "*" ) : class_name = class_name . strip ( "*" ) class_regex = re . compile ( r'.*?{}' . format ( class_name ) , re . I ) else : class_regex = re . compile ( r'^{}' . format ( class_name ) , re . I ) for c_name , c in cs : can_yield = True if class_regex and not class_regex . match ( c_name ) : #if class_name and class_name not in c_name: can_yield = False if can_yield and issubclass ( c , unittest . TestCase ) : if c is not unittest . TestCase : # ignore actual TestCase class logger . debug ( 'class: {} matches {}' . format ( c_name , class_name ) ) yield c
the partial self.class_name will be used to find actual TestCase classes
the partial self . class_name will be used to find actual TestCase classes