pytest-twisted
pytest-twisted copied to clipboard
test twisted code with pytest
#80 https://twistedmatrix.com/trac/ticket/9766 https://twistedmatrix.com/trac/ticket/9809
#4 Draft for: - [ ] Name[s] - [ ] Fixture? Decorator? Both? - Tests against - [ ] `@inlineCallbacks` - [ ] `@ensureDeferred`
When running pytest from Python code you might run it twice in the same process and this produces a `twisted.internet.error.ReactorNotRestartable` error. Maybe we can sensibly deal with this situation.
https://github.com/actions/setup-python/issues/151 https://github.com/tox-dev/tox/issues/1704 https://foss.heptapod.net/pypy/pypy/-/issues/3331
I ran across the following problem: if you have an unhandled exception somewhere in your Twisted stuff (e.g. a missing errback handler), pytest-twisted "hangs" and needs a ctrl-c to stop...
It seems to happen in the cleanup stage after all the tests of a TestCase, and marks the last test of that TestCase as a failure. ``` ===================================================================== test session...
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...
It was suggested that trial provides various checks after each test (or each test class?) to verify the reactor is in a good state. Let's review those features and see...