When testing twisted based functions, it is often desirable to be able to test with deterministic and controllable passage of time. Twisted's task.Clock provides this. If the function under test is using callLater or similar methods to create a delay, time can be fast-forwarded when the reactor is idle.
I'd like to propose adding functionality to pytest-twisted that allows for using Clock to accelerate passage of time during testing. Coincidentally it will be comparable to pytest-trio's autojump_clock, see https://pytest-trio.readthedocs.io/en/latest/quickstart.html#trio-s-magic-autojump-clock
I am currently working on some concepts and will discuss them here.
When testing twisted based functions, it is often desirable to be able to test with deterministic and controllable passage of time. Twisted's
task.Clockprovides this. If the function under test is usingcallLateror similar methods to create a delay, time can be fast-forwarded when the reactor is idle.I'd like to propose adding functionality to pytest-twisted that allows for using
Clockto accelerate passage of time during testing. Coincidentally it will be comparable to pytest-trio'sautojump_clock, see https://pytest-trio.readthedocs.io/en/latest/quickstart.html#trio-s-magic-autojump-clockI am currently working on some concepts and will discuss them here.