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

Side by Side Diff: tests/__init__.py

Issue 122040: Refactor the unit tests. (Closed)
Patch Set: even more cleanup Created 11 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/abandon.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for depot_tools.""" 6 """Unit tests for depot_tools."""
7
8 mox = None
9
10 def OnTestsLoad():
11 import os
12 import sys
13 old_path = sys.path
14 global mox
15 try:
16 directory, _file = os.path.split(__file__)
17 sys.path.append(os.path.abspath(os.path.join(directory, 'pymox')))
18 sys.path.append(os.path.abspath(os.path.join(directory, '..')))
19 try:
20 import mox as Mox
21 mox = Mox
22 except ImportError:
23 print "Trying to automatically checkout pymox."
24 import subprocess
25 subprocess.call(['svn', 'co', 'http://pymox.googlecode.com/svn/trunk',
26 os.path.join(directory, 'pymox')],
27 shell=True)
28 try:
29 import mox as Mox
30 mox = Mox
31 except ImportError:
32 print >> sys.stderr, ("\nError, failed to load pymox\n")
33 raise
34 finally:
35 # Restore the path
36 sys.path = old_path
37
38 OnTestsLoad()
OLDNEW
« no previous file with comments | « no previous file | tests/abandon.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698