Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 """Base test class for Legion-specific unittests. | |
| 6 | |
| 7 Currently this module is only needed to setup the import paths for the | |
| 8 unittests. This will allow unittests to use the import format: | |
| 9 | |
| 10 from legion.foo import bar | |
| 11 | |
| 12 Using this base class for all unittests allows for easier extensibility in | |
| 13 the future. | |
| 14 """ | |
| 15 | |
| 16 import os | |
| 17 import sys | |
| 18 import unittest | |
| 19 | |
| 20 # Setup import paths | |
| 21 THIS_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| 22 LEGION_IMPORT_FIX = os.path.join(THIS_DIR, '..', '..') | |
| 23 sys.path.append(LEGION_IMPORT_FIX) | |
| 24 | |
| 25 | |
| 26 class TestCase(unittest.TestCase): | |
| 27 pass | |
| 28 | |
| 29 | |
| 30 def main(): | |
| 31 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.
| |
| OLD | NEW |