~cbrandily/python-fixtures/cleanup-context

Viewing all changes in revision 96.

  • Committer: Cedric Brandily
  • Date: 2015-05-21 05:16:24 UTC
  • Revision ID: zzelle@gmail.com-20150521051624-lonjt6m2x23faxdy
Ensure cleanups are called even if setUp fails with fixture context

This change ensures that a fixture cleanups will be called even if
its setUp fails when used as a context.


Example:

  with MyFixture() as fixture1:
    pass

fixture1.cleanUp will be called even if fixture1.setUp (called in
fixture1.__enter__) fails.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: