Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: tests/super_mox.py

Issue 266043: Add pymox, fixed non-deterministic pprint.pformat output expectation.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« tests/gclient_test.py ('K') | « tests/pymox/stubout_testee.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/super_mox.py
===================================================================
--- tests/super_mox.py (revision 28584)
+++ tests/super_mox.py (working copy)
@@ -8,41 +8,9 @@
import os
import random
import string
+from pymox import mox
-mox = None
-def OnTestsLoad():
- import sys
- old_path = sys.path
- global mox
- try:
- directory, _file = os.path.split(__file__)
- sys.path.append(os.path.abspath(os.path.join(directory, 'pymox')))
- sys.path.append(os.path.abspath(os.path.join(directory, '..')))
- try:
- import mox as Mox
- mox = Mox
- except ImportError:
- print "Trying to automatically checkout pymox."
- import subprocess
- subprocess.call(['svn', 'co', 'http://pymox.googlecode.com/svn/trunk',
- os.path.join(directory, 'pymox')],
- shell=sys.platform.startswith('win'))
- try:
- import pymox.mox as Mox
- mox = Mox
- except ImportError:
- print >> sys.stderr, ("\nError, failed to load pymox\n")
- raise
- finally:
- # Restore the path
- sys.path = old_path
-
-
-# Automatically fetch pymox.
-OnTestsLoad()
-
-
class SuperMoxTestBase(mox.MoxTestBase):
# Backup the separator in case it gets mocked
_OS_SEP = os.sep
« tests/gclient_test.py ('K') | « tests/pymox/stubout_testee.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698