Replace tearDown with addCleanup in unit tests
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Low
|
Dave Chen |
Bug Description
tearDown should be replace by addCleanup in the unit tests to avoid stale state if setUp fails or any failure in tearDown method.
There is a bp in cinder project, just copy them here for reference,
"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."
Since the tearDown method is not used widely in keystone sub-project, so just file a bug to track the change."
The link of the reference: https:/
Changed in keystone: | |
assignee: | nobody → Dave Chen (wei-d-chen) |
description: | updated |
description: | updated |
Changed in keystone: | |
milestone: | none → liberty-3 |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | liberty-3 → 8.0.0 |
Fix proposed to branch: master /review. openstack. org/207753
Review: https:/