summaryrefslogtreecommitdiffstats
path: root/smoketests
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-03-18 13:14:37 +0100
committerSoren Hansen <soren@linux2go.dk>2011-03-18 13:14:37 +0100
commit6e632e9ef2907f0b00d3026379af03abe5024bc7 (patch)
treef6dc809c1cb397489b9a3ad9b4b6828e75cdd644 /smoketests
parentaa0d218e53afeb4403f0be2cf5251acb5efafc04 (diff)
downloadnova-6e632e9ef2907f0b00d3026379af03abe5024bc7.tar.gz
nova-6e632e9ef2907f0b00d3026379af03abe5024bc7.tar.xz
nova-6e632e9ef2907f0b00d3026379af03abe5024bc7.zip
Make flag parsing work again.
Diffstat (limited to 'smoketests')
-rw-r--r--smoketests/run_tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/smoketests/run_tests.py b/smoketests/run_tests.py
index 4f06f0f2b..e7f6eced7 100644
--- a/smoketests/run_tests.py
+++ b/smoketests/run_tests.py
@@ -60,12 +60,23 @@ import os
import unittest
import sys
+# If ../nova/__init__.py exists, add ../ to Python search path, so that
+# it will override what happens to be installed in /usr/(local/)lib/python...
+possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
+ os.pardir,
+ os.pardir))
+if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
+ sys.path.insert(0, possible_topdir)
+
+
gettext.install('nova', unicode=1)
from nose import config
from nose import core
from nose import result
+from smoketests import flags
+FLAGS = flags.FLAGS
class _AnsiColorizer(object):
"""
@@ -284,6 +295,7 @@ if __name__ == '__main__':
'running this test.')
sys.exit(1)
+ argv = FLAGS(sys.argv)
testdir = os.path.abspath("./")
c = config.Config(stream=sys.stdout,
env=os.environ,
@@ -294,4 +306,4 @@ if __name__ == '__main__':
runner = NovaTestRunner(stream=c.stream,
verbosity=c.verbosity,
config=c)
- sys.exit(not core.run(config=c, testRunner=runner, argv=sys.argv))
+ sys.exit(not core.run(config=c, testRunner=runner, argv=argv))