HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //usr/lib/python2.6/site-packages/nose/failure.py
import logging
import unittest
from traceback import format_tb

log = logging.getLogger(__name__)


__all__ = ['Failure']


# FIXME probably not the best name, since it is mainly used for errors
class Failure(unittest.TestCase):
    __test__ = False # do not collect
    def __init__(self, exc_class, exc_val, tb=None):
        log.debug("A failure! %s %s %s", exc_class, exc_val, format_tb(tb))
        self.exc_class = exc_class
        self.exc_val = exc_val
        self.tb = tb
        unittest.TestCase.__init__(self)

    def __str__(self):
        return "Failure: %s (%s)" % (
            getattr(self.exc_class, '__name__', self.exc_class), self.exc_val)

    def runTest(self):
        if self.tb is not None:            
            raise self.exc_class, self.exc_val, self.tb
        else:
            raise self.exc_class(self.exc_val)