Move from mocker -> mock (python 3 transition)

Bug #1258720 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned

Bug Description

It appears that mock is the mocking library going forward in python so it will likely be useful to transition from mocker (used in cloud-init) to mock so that cloud-init is more future compatible. https://pypi.python.org/pypi/mock exists for python2.5+ so it seems like if we transition then it will be less painful later.

Joshua Harlow (harlowja)
summary: - Move from mocker -> mock
+ Move from mocker -> mock (python 3 transition)
Revision history for this message
Scott Moser (smoser) wrote :

woudl be nice to move a lot of our tests to more consistently using a single mock/patch interface.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Dan Watkins (oddbloke) wrote :

I've pushed up an example of what replacing mocker with mock might look like, check the diff out at http://bazaar.launchpad.net/~daniel-thewatkins/cloud-init/replace-mocker/revision/1013?start_revid=1013 or the full file at http://bazaar.launchpad.net/~daniel-thewatkins/cloud-init/replace-mocker/view/head:/tests/unittests/test_distros/test_netconfig.py

This is only a POC as (amongst other things) I haven't updated requirements to include mock.

Revision history for this message
Michael Vogt (mvo) wrote :

I also pushed some code to lp:~mvo/cloud-init/py2-3 but there is a lot of work todo.

Revision history for this message
James Falcon (falcojr) wrote :

mock is now used everywhere

Changed in cloud-init:
status: Triaged → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.