Esempio n. 1
0
    def render_source_tree(self): 
        self.msg('crawling "%s" for files.' % self.test_spec['directory'])

        output = [ item for item
                        in expand_tree(self.test_spec['directory'], self.test_spec['extension'])
                        if item not in self.test_spec['exceptions'] ]

        return output
Esempio n. 2
0
    def _load_tree(self, path):
        """
        :param path: A file system path containing tests.

        An internal method that recursively loads all ``.yaml`` files,
        selected using :meth:`~utils.expand_tree()`, in ``path`` using
        :meth:`~core.TestRunner._load()`.
        """

        logger.debug('loading tests from tree {0} into TestRunner object'.format(path))
        for test in expand_tree(path):
            self._load(test)
        logger.debug('loaded tests from tree {0} into TestRunner object'.format(path))
Esempio n. 3
0
    def add(self):
        """
        Adds all modules, recursively, in
        :attr:`~core.CaseDefinition.case_paths` and calls
        :meth:`~core.CaseDefinition._add()` for each module. No
        arguments required when
        :attr:`~core.CaseDefinition.case_paths` is set.
        """

        logger.debug('adding cases to a multi-case definition object')
        for path in self.case_paths:
            module_path = get_module_path(path)

            logger.debug('adding cases in: {0}'.format(path))
            for f in expand_tree(path, 'py'):
                self._add(f, module_path)
            logger.debug('added cases in: {0}'.format(path))
        logger.debug('added all cases to a multi-case definition object.')