hook to have a callable called after test methods return

Bug #584824 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Incomplete
Wishlist
Robert Collins

Bug Description

E.g.

self.call_after_test_function(lambda _:storm.flush())

or

self.call_after_test_function(lambda x: reactor.run_until(x))

This would be useful for launchpad, and a step towards trial integration.

Revision history for this message
Jonathan Lange (jml) wrote :

I'm not sure that this would help with Twisted support.

Revision history for this message
Jonathan Lange (jml) wrote :

Also, what's the difference between this and addCleanup?

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 584824] Re: hook to have a callable called after test methods return

On Sun, Oct 24, 2010 at 9:47 PM, Jonathan Lange <email address hidden> wrote:
> Also, what's the difference between this and addCleanup?

addCleanup doth not receive testrunner state.

Revision history for this message
Jonathan Lange (jml) wrote :

Sorry, but I don't see what in those examples indicates testrunner state.

Revision history for this message
Robert Collins (lifeless) wrote :

The x/ _ was meant to indicate the return value from setUp/run/tearDown.

Revision history for this message
Jonathan Lange (jml) wrote :

Ahh ok. Why is that useful? I'm asking since we've got Twisted support now.

Revision history for this message
Robert Collins (lifeless) wrote :

Seemed like a useful way to do [similar] things without deeper changes.

Revision history for this message
Jonathan Lange (jml) wrote :

It seems like a cool thing, I just am not sure we should provide it without a solid use case. YAGNI and all that.

Revision history for this message
Robert Collins (lifeless) wrote :

Well, all of testtools is yagni :P but lets talk in person, this is a bit bitsy.

Jonathan Lange (jml)
Changed in testtools:
assignee: nobody → Jonathan Lange (jml)
status: Triaged → In Progress
status: In Progress → Triaged
assignee: Jonathan Lange (jml) → nobody
Revision history for this message
Jonathan Lange (jml) wrote :

Bug 906251 has, for a wonder, an actual use case for this.

Revision history for this message
Jonathan Lange (jml) wrote :

Spoke too soon. Unless it's dispatched by the type of the RunTest object it's not interesting.

Revision history for this message
Jonathan Lange (jml) wrote :

I can't remember whether we *did* speak in person. Would like to have a solid documented use case for this.

Changed in testtools:
status: Triaged → Incomplete
assignee: nobody → Robert Collins (lifeless)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.