Open adiroiban opened 4 years ago
Here is my fix for txacme to help detect "drity" tests.
I guess that this is a common patter in all Twisted tests and we might have something like this in testtools
https://github.com/twisted/txacme/pull/140/commits/1a49fcbb2700f9caa812b5bd95be708f185a36e2
This is an issue I found in txacme..
There was a test not using AsynchronousDeferredRunTest but using the main reactor and it left the reactor dirty...
Then, another test was executed with AsynchronousDeferredRunTest and the main reactor. This test was fine, but test were still failing as it was now detecting that reactor is not clean.
I think that in twistedsuppor there should be a dedicated TestCase to check for junk at tearDown for the main reactor
Also, I think that besides delayedcalls, readers and writers and threads should also be considered junk
For my projects I am using a simplified TwistedTestCase on top of stdlib TestCase and here is the reactor cleanup check that I use:
https://github.com/chevah/compat/blob/master/chevah/compat/testing/testcase.py#L310