Opened 11 years ago

Last modified 7 years ago

#212 new defect

replace foolscap.test.common.ShouldFailMixin.shouldFail with twisted.trial.unittest.TestCase.failUnlessFailure ?

Reported by: Zooko Owned by:
Priority: major Milestone: eventually
Component: unknown Version: 0.6.4
Keywords: Cc:

Description (last modified by Brian Warner)

The foolscap shouldFail thing can require substrings, so maybe we need to use twisted.trial.unittest.TestCase.failUnlessSubstring too.

Change History (3)

comment:1 Changed 11 years ago by Brian Warner

Description: modified (diff)
Milestone: undecided0.6.5

I'm all for removing code, but we're currently compatible all the way back to Twisted-2.5.0, and I'd like to know what we're giving up to make a change like that.

In which version of Twisted did failUnlessFailure first appear?

(also, I think we probably have multiple versions of shouldFail, so we can probably consolidate them at the same time).

comment:2 Changed 10 years ago by Brian Warner

Milestone: 0.6.5eventually

I still think this is probably a good idea, but I'm no longer concerned about getting it into any particular release, including 0.6.5

comment:3 Changed 7 years ago by Brian Warner

At this point, it should be replaced with e = yield self.assertFailure(f, *exceptionTypes), followed by an extra self.assertIn(substr, str(e)) when needed

And ideally we should avoid waiting for Deferreds at all, and use f = self.failureResultOf(d) which is synchronous.

Note: See TracTickets for help on using tickets.