cleanups not called when fixture setUp fails with useFixture

Bug #1456370 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Undecided
Cedric Brandily

Bug Description

When we do:

  class MyTest(testtools.TestCase):
    def test(self):
      self.useFixture(fixture2)

fixture2 cleanups are only called if self.addCleanup(fixture2.cleanUp) is called ... but it's done only if fixture2.setUp succeed[1]

[1] https://github.com/testing-cabal/testtools/blob/55278e0e4a935f1d8c468a4d29a8133088806790/testtools/testcase.py#L681

Changed in testtools:
assignee: nobody → Cedric Brandily (cbrandily)
Changed in testtools:
status: New → In Progress
Revision history for this message
Cedric Brandily (cbrandily) wrote :

The problem has been solved by the definition of _setUp

Changed in testtools:
status: In Progress → 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.