Replace tearDown with addCleanup in magnum unit tests
Bug #1476976 reported by
Hua Wang
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Magnum |
Fix Released
|
Undecided
|
Hua Wang |
Bug Description
Infra team has indicated that tearDown methods should be replaced with addCleanup in unit tests.
The reason is that 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.
So, we should replace tearDown with addCleanup methods.
Changed in magnum: | |
assignee: | nobody → Hua Wang (humble00) |
Changed in magnum: | |
milestone: | none → mitaka-1 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Fix proposed to branch: master /review. openstack. org/204925
Review: https:/