cleanups not called when setUp fails when a fixture is used as a context
Bug #1456361 reported by
Cedric Brandily
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://
Related branches
lp:~cbrandily/python-fixtures/cleanup-context
Ready for review
for merging
into
lp:python-fixtures
- Robert Collins: Disapprove
-
Diff: 80 lines (+54/-5)2 files modifiedfixtures/fixture.py (+6/-5)
fixtures/tests/test_fixture.py (+48/-0)
Changed in python-fixtures: | |
assignee: | nobody → Cedric Brandily (cbrandily) |
Changed in python-fixtures: | |
status: | New → In Progress |
Changed in python-fixtures: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
I wanted to capture the logic here for easy later review..., so I did a blog post. https:/ /rbtcollins. wordpress. com/2015/ 06/22/revisitin g-the-fixture- api-handling- leaky-resources /