How to use the catcher.utils.logger.log_storage.test_end function in catcher

To help you get started, we’ve selected a few catcher examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github comtihon / catcher / catcher / core / runner.py View on Github external
test = None
        try:
            test = self.prepare_test(file, variables)
            logger.log_storage.test_start(file)
            test.run()
            info('Test ' + file + logger.green(' passed.'))
            logger.log_storage.test_end(file, True)
            return test, True
        except SkipException:
            info('Test ' + file + logger.yellow(' skipped.'))
            logger.log_storage.test_end(file, True, end_comment='Skipped')
            return test, True
        except Exception as e:
            warning('Test ' + file + logger.red(' failed: ') + str(e))
            debug(traceback.format_exc())
            logger.log_storage.test_end(file, False, str(e))
            return test, False
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_test(self, file, variables):
        test = None
        try:
            test = self.prepare_test(file, variables)
            logger.log_storage.test_start(file)
            test.run()
            info('Test ' + file + logger.green(' passed.'))
            logger.log_storage.test_end(file, True)
            return test, True
        except SkipException:
            info('Test ' + file + logger.yellow(' skipped.'))
            logger.log_storage.test_end(file, True, end_comment='Skipped')
            return test, True
        except Exception as e:
            warning('Test ' + file + logger.red(' failed: ') + str(e))
            debug(traceback.format_exc())
            logger.log_storage.test_end(file, False, str(e))
            return test, False
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_test(self, file, variables):
        test = None
        try:
            test = self.prepare_test(file, variables)
            logger.log_storage.test_start(file)
            test.run()
            info('Test ' + file + logger.green(' passed.'))
            logger.log_storage.test_end(file, True)
            return test, True
        except SkipException:
            info('Test ' + file + logger.yellow(' skipped.'))
            logger.log_storage.test_end(file, True, end_comment='Skipped')
            return test, True
        except Exception as e:
            warning('Test ' + file + logger.red(' failed: ') + str(e))
            debug(traceback.format_exc())
            logger.log_storage.test_end(file, False, str(e))
            return test, False
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_include(test, file, include_file, ignore_errors):
        """
        Run include as soon as it was included (run on include)
        """
        try:
            logger.log_storage.test_start(include_file['file'], test_type='include')
            debug('Run include: ' + str(test))
            res = test.run()
            logger.log_storage.test_end(test.path, True, res, test_type='include')
            return True
        except SkipException:
            info('Include ' + file + logger.yellow(' skipped.'))
            logger.log_storage.test_end(file, True, end_comment='Skipped')
            return True
        except Exception as e:
            logger.log_storage.test_end(test.path, False, str(e), test_type='include')
            if not ignore_errors:
                raise Exception('Include ' + file + ' failed: ' + str(e))
            return False
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_finally(cls, test, file, result: bool):
        if test and test.final:
            logger.log_storage.test_start(file, test_type='{}_cleanup'.format(file))
            try:
                test.run_finally(result)
                info('Test ' + file + ' [cleanup] ' + logger.green(' passed.'))
                logger.log_storage.test_end(file, True, test_type='{} [cleanup]'.format(file))
            except Exception as e:
                warning('Test ' + file + ' [cleanup] ' + logger.red(' failed: ') + str(e))
                debug(traceback.format_exc())
                logger.log_storage.test_end(file, False, test_type='{} [cleanup]'.format(file))
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_finally(cls, test, file, result: bool):
        if test and test.final:
            logger.log_storage.test_start(file, test_type='{}_cleanup'.format(file))
            try:
                test.run_finally(result)
                info('Test ' + file + ' [cleanup] ' + logger.green(' passed.'))
                logger.log_storage.test_end(file, True, test_type='{} [cleanup]'.format(file))
            except Exception as e:
                warning('Test ' + file + ' [cleanup] ' + logger.red(' failed: ') + str(e))
                debug(traceback.format_exc())
                logger.log_storage.test_end(file, False, test_type='{} [cleanup]'.format(file))
github comtihon / catcher / catcher / core / runner.py View on Github external
def _run_include(test, file, include_file, ignore_errors):
        """
        Run include as soon as it was included (run on include)
        """
        try:
            logger.log_storage.test_start(include_file['file'], test_type='include')
            debug('Run include: ' + str(test))
            res = test.run()
            logger.log_storage.test_end(test.path, True, res, test_type='include')
            return True
        except SkipException:
            info('Include ' + file + logger.yellow(' skipped.'))
            logger.log_storage.test_end(file, True, end_comment='Skipped')
            return True
        except Exception as e:
            logger.log_storage.test_end(test.path, False, str(e), test_type='include')
            if not ignore_errors:
                raise Exception('Include ' + file + ' failed: ' + str(e))
            return False