Post-processing of Twisted logs requires overriding TestCase.run

Bug #1515362 reported by Jonathan Lange
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Undecided
Jonathan Lange

Bug Description

Currently, if you want to do post-processing of attached Twisted logs (using AsynchronousDeferredRunTest, aka ADRT), then you have to override TestCase.run(), since the Twisted logs aren't attached until *after* the ADRT is finished with user code.

We don't want to encourage overriding TestCase.run, so instead we should:

* Publish a fixture for capturing Twisted logs
* Use this fixture in ADRT
* Provide a means of disabling the automatic capturing of logs in ADRT (probably a new optional parameter)

Then users who want to do post-processing could do:

  self.addCleanup(post_process_logs)
  self.useFixture(CaptureTwistedLogs())

Revision history for this message
Jonathan Lange (jml) wrote :
Changed in testtools:
status: New → In Progress
assignee: nobody → Jonathan Lange (jml)
Jonathan Lange (jml)
Changed in testtools:
milestone: none → next
status: In Progress → Fix Committed
Jonathan Lange (jml)
Changed in testtools:
status: Fix Committed → Fix Released
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.