Re: [Twisted-Python] automated tests for a server application

On 06/11/2018 05:43, Moshe Zadka wrote:
Cool, do you have any example tests that do this? Interesting, looks like pytest-twisted does away for the need for this by showing how to install a fake reactor globally: https://github.com/pytest-dev/pytest-twisted/blob/master/pytest_twisted.py#L...
Not sure I fully understand this, why is the MemoryReactor bad to use? Where is it used?
So, clock is just a clock, right? How would that get worked into a "real" reactor for testing?
pytest-twisted looks like it supports this pattern too, allowing test functions to return deferreds... I guess I'm still really looking to see examples of all of this... Chris

On November 6, 2018 6:41:23 AM EST, Chris Withers <chris@simplistix.co.uk> wrote:
What is 'fake' about this globally installed normally-the-default reactor? (Otherwise the qt5reactor if chosen)
I use @pytest_twisted.inlineCallbacks anyways, yes. Overall I'm not clear what was recommended here. Why fake the reactor? Even if not using a 'real client' wouldn't you just fake the data going through the connections rather than faking the entire reactor? Cheers, -kyle

On November 6, 2018 6:41:23 AM EST, Chris Withers <chris@simplistix.co.uk> wrote:
What is 'fake' about this globally installed normally-the-default reactor? (Otherwise the qt5reactor if chosen)
I use @pytest_twisted.inlineCallbacks anyways, yes. Overall I'm not clear what was recommended here. Why fake the reactor? Even if not using a 'real client' wouldn't you just fake the data going through the connections rather than faking the entire reactor? Cheers, -kyle
participants (2)
-
Chris Withers
-
Kyle Altendorf