module documentation
(source)

Assorted functionality which is commonly useful when writing unit tests.
Class ​Accumulating​Protocol AccumulatingProtocol is an IProtocol implementation which collects the data delivered to it and can fire a Deferred when it is connected or disconnected.
Class ​Event​Logging​Observer No summary
Class ​Fake​Datagram​Transport Undocumented
Class ​Line​Sending​Protocol Undocumented
Class ​Memory​Reactor A fake reactor to be used in tests. This reactor doesn't actually do much that's useful yet. It accepts TCP connection setup attempts, but they will never succeed.
Class ​Memory​Reactor​Clock Undocumented
Class ​Non​Streaming​Producer A pull producer which writes 10 times only.
Class ​Raising​Memory​Reactor A fake reactor to be used in tests. It accepts TCP connection setup attempts, but they will fail.
Class ​String​IOWithout​Closing A BytesIO that can't be closed.
Class ​String​Transport A transport implementation which buffers data in memory and keeps track of its other state without providing any behavior.
Class ​String​Transport​With​Disconnection A StringTransport which on disconnection will trigger the connection lost on the attached protocol.
Function wait​Until​All​Disconnected Take a list of disconnecting protocols, callback a Deferred when they're all done.
Class _​Fake​Connector A fake IConnector that allows us to inspect if it has been told to stop connecting.
Class _​Fake​Port A fake IListeningPort to be used in tests.
def waitUntilAllDisconnected(reactor, protocols): (source)

Take a list of disconnecting protocols, callback a Deferred when they're all done.

This is a hack to make some older tests less flaky, as ITransport.loseConnection is not atomic on all reactors (for example, the CoreFoundation, which sometimes takes a reactor turn for CFSocket to realise). New tests should either not use real sockets in testing, or take the advice in https://jml.io/pages/how-to-disconnect-in-twisted-really.html to heart.

Parameters
reactor:IReactorTimeThe reactor to schedule the checks on.
protocols:A list of IProtocols.The protocols to wait for disconnecting.