]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Replace tearDown with addCleanup - Part 4
authorJulia Varlamova <jvarlamova@mirantis.com>
Fri, 21 Feb 2014 06:50:46 +0000 (10:50 +0400)
committerJulia Varlamova <jvarlamova@mirantis.com>
Tue, 15 Apr 2014 13:46:08 +0000 (17:46 +0400)
commit6ee7901df927a1e94d0e63950b46c85e5b8cd732
tree95f55205c7ecb992db026a07a6e59abe77a6f0f4
parent7cd6d18c28ac552ddf4b76f75b6da470b44fc812
Replace tearDown with addCleanup - Part 4

Infra team has indicated that tearDown should not be used and should
be replaced with addCleanup in all places.

All addCleanup methods will be executed even if one of them fails, while
a failure in tearDown method can leave the rest of the tearDown un-executed,
which can leave stale state laying around.

Moreover, tearDown methods won't run if an exception raises in setUp method,
while addCleanup will run in such case.

This patch replaces tearDown with addCleanup or removes redundant tearDown
methods in cinder unit tests.

Implements blueprint replace-teardown-with-addcleanup

Change-Id: I6947eafa419ed7dda53582484090cd5210274f73
16 files changed:
cinder/tests/api/v1/test_limits.py
cinder/tests/api/v1/test_volumes.py
cinder/tests/db/test_finish_migration.py
cinder/tests/db/test_name_id.py
cinder/tests/db/test_qos_specs.py
cinder/tests/db/test_transfers.py
cinder/tests/test_backup.py
cinder/tests/test_backup_ceph.py
cinder/tests/test_backup_driver_base.py
cinder/tests/test_backup_tsm.py
cinder/tests/test_drivers_compatibility.py
cinder/tests/test_emc_smis.py
cinder/tests/test_huawei_t_dorado.py
cinder/tests/test_rbd.py
cinder/tests/test_volume_configuration.py
cinder/tests/test_zadara.py