MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
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)