cleanups not called when setUp fails when a fixture is used as a context

Bug #1456361 reported by Cedric Brandily
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Fixtures
Fix Released
High
Robert Collins

Bug Description

When we do:

  with fixture2:
    pass

fixture2.__exit__ is called only if fixture2.__enter__ succeed, it implies fixture2 cleanups (done in __exit__[1]) are only done if fixture2 setUp succeed (done in __enter__[1])

[1] http://bazaar.launchpad.net/~testing-cabal/python-fixtures/master/view/head:/fixtures/fixture.py

Related branches

Changed in python-fixtures:
assignee: nobody → Cedric Brandily (cbrandily)
Changed in python-fixtures:
status: New → In Progress
Revision history for this message
Robert Collins (lifeless) wrote :

I wanted to capture the logic here for easy later review..., so I did a blog post. https://rbtcollins.wordpress.com/2015/06/22/revisiting-the-fixture-api-handling-leaky-resources/

Changed in python-fixtures:
assignee: Cedric Brandily (cbrandily) → Robert Collins (lifeless)
importance: Undecided → High
milestone: none → next
Changed in python-fixtures:
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.