class documentation
class EventLoggingObserver(Sequence[
Constructor: EventLoggingObserver.createWithCleanup(testInstance, publisher)
Implements interfaces: twisted.logger.ILogObserver
ILogObserver
That stores its events in a list for later inspection. This class is similar to LimitedHistoryLogObserver
save that the internal buffer is public and intended for external inspection. The observer implements the sequence protocol to ease iteration of the events.
Class Method | create |
Create an EventLoggingObserver instance that observes the provided publisher and will be cleaned up with addCleanup(). |
Method | __call__ |
No summary |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Instance Variable | _events |
The events captured by this observer |
@classmethod
def createWithCleanup(cls, testInstance:
def createWithCleanup(cls, testInstance:
TestCase
, publisher: LogPublisher
) -> Self
:
(source)
¶
Create an EventLoggingObserver
instance that observes the provided publisher and will be cleaned up with addCleanup().
Parameters | |
testtwisted.trial.unittest.TestCase | Test instance in which this logger is used. |
publisher:twisted.logger.LogPublisher | Log publisher to observe. |
Returns | |
twisted.test.proto_helpers.EventLoggingObserver | An EventLoggingObserver configured to observe the provided publisher. |