Chromium Code Reviews| Index: testing/legion/unittests/legion_unittest.py |
| diff --git a/testing/legion/unittests/legion_unittest.py b/testing/legion/unittests/legion_unittest.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2d9eb9e315a9fc0d835e271fc281830e4e565c69 |
| --- /dev/null |
| +++ b/testing/legion/unittests/legion_unittest.py |
| @@ -0,0 +1,31 @@ |
| +# Copyright 2015 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. |
| + |
| +"""Base test class for Legion-specific unittests. |
| + |
| +Currently this module is only needed to setup the import paths for the |
| +unittests. This will allow unittests to use the import format: |
| + |
| +from legion.foo import bar |
| + |
| +Using this base class for all unittests allows for easier extensibility in |
| +the future. |
| +""" |
| + |
| +import os |
| +import sys |
| +import unittest |
| + |
| +# Setup import paths |
| +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) |
| +LEGION_IMPORT_FIX = os.path.join(THIS_DIR, '..', '..') |
| +sys.path.append(LEGION_IMPORT_FIX) |
| + |
| + |
| +class TestCase(unittest.TestCase): |
| + pass |
| + |
| + |
| +def main(): |
| + unittest.main(verbosity=0, argv=sys.argv[:1]) |
|
M-A Ruel
2016/01/18 21:57:37
In events/task.py you use:
sys.argv[1:] = args.un
Mike Meade
2016/01/19 21:53:23
Done.
|