← Back to team overview

subunit-dev team mailing list archive

wasSuccessful() returning False after errors

 

I've done some work recently cleaning up a patch of Rob's to get a
subunit reporter into Twisted.

In the initial patch, Rob added interface tests for Trial reporters
(which is what Twisted calls test results). They didn't test the whole
reporter interface, just enough, I believe, to drive the changes
needed for the patch.

I changed the approach of the patch, such that it wrapped up
subunit.TestProtocolClient, rather than inheriting from it. This
didn't break tests, but it did break running the tests with the
subunit reporter. So I added tests and fixed code until running 'trial
--subunit twisted.trial' worked.

One test I added was for the behaviour of wasSuccessful(). The test
shows that wasSuccessful() returns True, then returns False after
addError() is called. I figure this is a valid interface test.

I've made the test pass by having wasSuccessful logic in the wrapper.
Personally, I think the logic should be in TestProtocolClient.
Otherwise, I don't see why it should even defined as a method at all.

Anyway, these are my thoughts.

jml



Follow ups