K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / trial / _dist /
server ip : 172.67.156.115

your ip : 172.69.214.189

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/trial/_dist/distreporter.py
Size2.43 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified17-Sep-2012 16:16
Last accessed07-Jul-2025 07:29
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# -*- test-case-name: twisted.trial._dist.test.test_distreporter -*-
#
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
The reporter is not made to support concurrent test running, so we will
hold test results in here and only send them to the reporter once the
test is over.

@since: 12.3
"""

from zope.interface import implements
from twisted.trial.itrial import IReporter
from twisted.python.components import proxyForInterface



class DistReporter(proxyForInterface(IReporter)):
"""
See module docstring.
"""

implements(IReporter)

def __init__(self, original):
super(DistReporter, self).__init__(original)
self.running = {}


def startTest(self, test):
"""
Queue test starting.
"""
self.running[test.id()] = []
self.running[test.id()].append((self.original.startTest, test))


def addFailure(self, test, fail):
"""
Queue adding a failure.
"""
self.running[test.id()].append((self.original.addFailure,
test, fail))


def addError(self, test, error):
"""
Queue error adding.
"""
self.running[test.id()].append((self.original.addError,
test, error))


def addSkip(self, test, reason):
"""
Queue adding a skip.
"""
self.running[test.id()].append((self.original.addSkip,
test, reason))


def addUnexpectedSuccess(self, test, todo):
"""
Queue adding an unexpected success.
"""
self.running[test.id()].append((self.original.addUnexpectedSuccess,
test, todo))


def addExpectedFailure(self, test, error, todo):
"""
Queue adding an unexpected failure.
"""
self.running[test.id()].append((self.original.addExpectedFailure,
test, error, todo))


def addSuccess(self, test):
"""
Queue adding a success.
"""
self.running[test.id()].append((self.original.addSuccess, test))


def stopTest(self, test):
"""
Queue stopping the test, then unroll the queue.
"""
self.running[test.id()].append((self.original.stopTest, test))
for step in self.running[test.id()]:
apply(step[0], step[1:])
del self.running[test.id()]