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

Side by Side Diff: gm/rebaseline_server/base_unittest.py

Issue 424263005: teach rebaseline_server to generate diffs of rendered SKPs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ravi comments Created 6 years, 4 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 | « DEPS ('k') | gm/rebaseline_server/compare_rendered_pictures.py » ('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 2
3 """ 3 """
4 Copyright 2014 Google Inc. 4 Copyright 2014 Google Inc.
5 5
6 Use of this source code is governed by a BSD-style license that can be 6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file. 7 found in the LICENSE file.
8 8
9 A wrapper around the standard Python unittest library, adding features we need 9 A wrapper around the standard Python unittest library, adding features we need
10 for various unittests within this directory. 10 for various unittests within this directory.
11 """ 11 """
12 12
13 # System-level imports. 13 # System-level imports.
14 import os 14 import os
15 import sys 15 import sys
16 16
17 PARENT_DIR = os.path.abspath(os.path.dirname(__file__)) 17 PARENT_DIR = os.path.abspath(os.path.dirname(__file__))
18 TRUNK_DIR = os.path.abspath(os.path.join(PARENT_DIR, os.pardir, os.pardir)) 18 TRUNK_DIR = os.path.abspath(os.path.join(PARENT_DIR, os.pardir, os.pardir))
19 19
20 # Import the superclass base_unittest module from the tools dir. 20 # Import the superclass base_unittest module from the tools dir.
21 #
22 # TODO(epoger): If I don't put this at the beginning of sys.path, the import of
23 # tests.base_unittest fails. That's bad. I need to come up with a cleaner way
24 # of doing this... I think this will involve changing how we import the "boto"
25 # library in gs_utils.py, within the common repo.
21 TOOLS_DIR = os.path.join(TRUNK_DIR, 'tools') 26 TOOLS_DIR = os.path.join(TRUNK_DIR, 'tools')
22 if TOOLS_DIR not in sys.path: 27 if TOOLS_DIR != sys.path[0]:
23 sys.path.append(TOOLS_DIR) 28 sys.path.insert(0, TOOLS_DIR)
24 import tests.base_unittest as superclass_module 29 import tests.base_unittest as superclass_module
25 30
26 31
27 class TestCase(superclass_module.TestCase): 32 class TestCase(superclass_module.TestCase):
28 33
29 def __init__(self, *args, **kwargs): 34 def __init__(self, *args, **kwargs):
30 super(TestCase, self).__init__(*args, **kwargs) 35 super(TestCase, self).__init__(*args, **kwargs)
31 # Some of the tests within this package want their output validated, 36 # Some of the tests within this package want their output validated,
32 # so we declare where the expected and actual output will be. 37 # so we declare where the expected and actual output will be.
33 self._testdata_dir = os.path.join(PARENT_DIR, 'testdata') 38 self._testdata_dir = os.path.join(PARENT_DIR, 'testdata')
34 39
35 def main(*args, **kwargs): 40 def main(*args, **kwargs):
36 superclass_module.main(*args, **kwargs) 41 superclass_module.main(*args, **kwargs)
OLDNEW
« no previous file with comments | « DEPS ('k') | gm/rebaseline_server/compare_rendered_pictures.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698