Comment 2 for bug 637674

Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 637674] [NEW] RemotedTestCase.addCleanup exists but fails under Python 2.7

Robert Collins wrote:
> > bzr at one point has this code:
> >
> >        # Only check for thread leaks if the test case supports cleanups
> >        addCleanup = getattr(test, "addCleanup", None)
> >        if addCleanup is not None:
> >            addCleanup(self._check_leaked_threads, test)
>
> Thats buggy code though.

I'm not surprised. Care to elaborate though? (I think I have a fair idea
why, but it'd prefer not to guess.)

Regardless, RemotedTestCase inheriting from TestCase without up-calling
seems pretty fragile, and likely to be a source of trouble as the standard
unittest.TestCase implementation keeps evolving.