Details added in fixture cleanup are not gathered
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Fixtures |
Triaged
|
Wishlist
|
Unassigned | ||
testtools |
Invalid
|
Medium
|
Unassigned |
Bug Description
useFixture does this::
try:
except:
raise
else:
return fixture
(python-fixtures has a useFixture that's very similar).
Note that the details gathering will run *before* the call to cleanup. This means any details added in cleanup will not be included in the gathered details.
Here's a test that could go into testtools's test_fixturesup
def test_useFixture
# Details added during fixture clean up are gathered.
class CleanupDetail(
def setUp(self):
fixture = CleanupDetail()
class SimpleTest(
def test_foo(self):
result = ExtendedTestRes
details = result.
It's a pretty easy fix (just swap the addCleanup calls around), but I'm not sure if that introduce different bugs.
Changed in python-fixtures: | |
status: | New → Triaged |
importance: | Undecided → Wishlist |
Changed in testtools: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: details fixtures |
Not being able to add details during cleanup removes a valuable channel for providing debugging information.