details fail to be collected from fixture

Bug #1323566 reported by Stuart Bishop
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Fixtures
Triaged
High
Unassigned

Bug Description

TestWithFixtures.useFixture.useFixture() has broken detail collection, as gather_details callback added with addCleanup is given the wrong arguments:

                self.addCleanup(gather_details, fixture, self)

The gather_details method now takes two dictionaries as arguments, not objects. The previous call is the bare except handler is correct.

The simple fix won't work, as fixture.getDetails() returns a copy of the details dictionary, rather than a reference. A lambda should do the trick.

Revision history for this message
Stuart Bishop (stub) wrote :

This code demonstrates the issue, and that defering the call to gather_details fixes some of the issues. Note however that details collected in the fixture's cleanup routines are not reported due to the run order of the cleanup hooks. Gathering the details in Fixture.cleanUp, after running all the hooks, is probably best.

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

Interesting; TestWithFixtures should probably die as its all upstream in testtools now. At the least we can deprecate it.

Changed in python-fixtures:
status: New → Triaged
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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