Do not use contextlib.nested if only mock one function
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Guangya Liu (Jay Lau) |
Bug Description
There are some test cases in test_compute_mgr.py using contextlib.nested to mock up functions even there is only one function.
We should use mock.patch.object directly if only mock one function.
def test_init_
with contextlib.nested( <<<<< No need use nested here
) as (
):
call = mock.call(
Changed in nova: | |
assignee: | nobody → Jay Lau (jay-lau-513) |
Changed in nova: | |
milestone: | none → icehouse-2 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-2 → 2014.1 |
Fix proposed to branch: master /review. openstack. org/63670
Review: https:/