]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Define SafeFixture base fixture
authorCedric Brandily <zzelle@gmail.com>
Thu, 11 Jun 2015 20:12:01 +0000 (22:12 +0200)
committerCedric Brandily <zzelle@gmail.com>
Thu, 25 Jun 2015 13:01:11 +0000 (13:01 +0000)
commit4b4cedaf853664535c05d47c99c920e74d1deb3a
tree8d72a1686ed7228d0d7552e188408cd06ec8f5e6
parent364e7bb4f0fbbf9d11bfb727ccabc40cc48ad9b7
Define SafeFixture base fixture

Currenty useFixture(myfixture)[1] ensures to call myfixture.cleanUp only
if myfixture.setUp succeed.

This change defines a workaround to ensure cleanUp call even if setUp
fails until testtools/fixtures support it: SafeFixture[2] which ensures
cleanUp call if setUp fails and replaces fixtures.Fixture use by
SafeFixture. This workaround will be removed when the bug will fixed in
testtools and fixtures[3].

[1] testtools.TestCase.useFixture, fixtures.Fixture.useFixture
[2] neutron.tests.tools
[3] see related bugs

Change-Id: I875934e8dde321a450c83fb95d175affd1f3bb83
Closes-Bug: #1464410
Partial-Bug: #1453888
Related-Bug: #1456353
Related-Bug: #1456370
neutron/tests/base.py
neutron/tests/common/machine_fixtures.py
neutron/tests/common/net_helpers.py
neutron/tests/fullstack/config_fixtures.py
neutron/tests/fullstack/fullstack_fixtures.py
neutron/tests/functional/agent/linux/helpers.py
neutron/tests/functional/test_tools.py [new file with mode: 0644]
neutron/tests/retargetable/client_fixtures.py
neutron/tests/tools.py
neutron/tests/unit/plugins/ml2/test_plugin.py
neutron/tests/unit/testlib_api.py