summaryrefslogtreecommitdiffstats
path: root/mojo/tools/run_mojo_python_tests.py
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-24 18:05:34 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-24 18:05:34 +0000
commit50faa3885d648e5a1d380ea3460681dc2b8e24dc (patch)
tree52e0dd862118c444849836af24d14db8068a637c /mojo/tools/run_mojo_python_tests.py
parentd3ad5eb99e0b7a7c02b757a28bfc1d558035b051 (diff)
downloadchromium_src-50faa3885d648e5a1d380ea3460681dc2b8e24dc.zip
chromium_src-50faa3885d648e5a1d380ea3460681dc2b8e24dc.tar.gz
chromium_src-50faa3885d648e5a1d380ea3460681dc2b8e24dc.tar.bz2
Mojo: Move mojom (python) unittests to mojom_tests package and combine errors.
Adds a base class for errors, so that the top-level doesn't have to know about different kinds of errors. (Still to do: Factor out ProcessFile(), so that it can throw appropriate errors too. This will make it properly unit-test-able.) There are two reasons to move the unit tests: * Relative imports: It's very convenient to be able to do "python foo_unittests.py". I want to be able to use a relative import (i.e., from parser.py, do "from ..error import Error"), but this only works if Python thinks I'm in a package (which it won't, if parser_unittests.py lives right beside parser.py, and is just doing "import parser"). * "Hygiene": Probably, if one were foolish enough to install the mojom package in a "global" location, one wouldn't want to install the tests. (Moreover, one probably doesn't typically want to import unit tests.) Note that Python unittests (using the unittest package) have to be importable, so it's natural that they live under pylib. Also fix/suppress various pylint warnings. (Note: generate/ still has some nontrivial pylint warnings, which need more attention.) R=darin@chromium.org Review URL: https://codereview.chromium.org/247933004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/tools/run_mojo_python_tests.py')
-rwxr-xr-xmojo/tools/run_mojo_python_tests.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mojo/tools/run_mojo_python_tests.py b/mojo/tools/run_mojo_python_tests.py
index 48b723c..2bee0ab 100755
--- a/mojo/tools/run_mojo_python_tests.py
+++ b/mojo/tools/run_mojo_python_tests.py
@@ -1,4 +1,4 @@
-#!/bin/python
+#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -28,7 +28,7 @@ def main():
loader = unittest.loader.TestLoader()
print "Running Python unit tests under mojo/public/tools/bindings/pylib ..."
suite = loader.discover(os.path.join(chromium_src_dir, 'mojo', 'public',
- 'tools', 'bindings', 'pylib'),
+ 'tools', 'bindings', 'pylib'),
pattern='*_unittest.py')
runner = unittest.runner.TextTestRunner(verbosity=(options.verbose+1))