Pull in mock-1.0.1.
Gprecise users have 0.7.x- which unless they know >=1.0 is required,
get random 'fun' errors in trying to run tests.
That leaves the original workaround of using pip to do the install.
Pulling in system level modules via a third party manager that's out
of the purview of all maintenance/puppet/etc awareness is a recipe
for pain- especially considering pip installs the *latest* version,
meaning they do a release breaking API, we get to suffer the fun.
More importantly, this has to be controlled deps so that we can run
these tests on builders. Pip isn't controlled.
This pulls the module in, then shifts the mock import to follow after
third_party has been injected into the python path. Not hugely optimal,
but proper cleanup is a followup step (this just reasserts control).
BUG=chromium-os:37472, chromiums-os:37517
TEST=punt all python-mock/mock installs, run the tests, things behave.
Change-Id: Ia62a05c0d59bd90d611a9c386433d365e857d8e8
Reviewed-on: https://gerrit.chromium.org/gerrit/40180
Commit-Queue: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
diff --git a/scripts/deploy_chrome_unittest.py b/scripts/deploy_chrome_unittest.py
index 867446c..cf1892b 100755
--- a/scripts/deploy_chrome_unittest.py
+++ b/scripts/deploy_chrome_unittest.py
@@ -4,7 +4,6 @@
# found in the LICENSE file.
-import mock
import os
import sys
@@ -16,6 +15,10 @@
from chromite.lib import remote_access_unittest
from chromite.scripts import deploy_chrome
+# TODO(build): Finish test wrapper (http://crosbug.com/37517).
+# Until then, this has to be after the chromite imports.
+import mock
+
# pylint: disable=W0212