From 49487a6ac63ae32b61687d9e8aeb0956590445d7 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Thu, 27 Sep 2012 10:50:19 -0700 Subject: Remove run_test.py in favor of stock nose. Move specific functionality into test fixtures, so that normal test runners can work. For now, this means we can use unaltered nose. For the future, it gets us closer to being able to use other test runners such as testrepository which allow for things like parallel test runs and re-running failed tests in a dev/test cycle. Also, aligns keystone with nova and glance. Change-Id: Ic1966281c0bdfbc09792360209692e9d4a0a51a7 --- keystone/common/sql/util.py | 5 +++++ keystone/test.py | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'keystone') diff --git a/keystone/common/sql/util.py b/keystone/common/sql/util.py index 195adc83..65e87bec 100644 --- a/keystone/common/sql/util.py +++ b/keystone/common/sql/util.py @@ -35,3 +35,8 @@ def setup_test_database(): shutil.copyfile('test.db.pristine', 'test.db') except Exception: pass + + +def teardown_test_database(): + if os.path.exists('test.db.pristine'): + os.unlink('test.db.pristine') diff --git a/keystone/test.py b/keystone/test.py index 44857d7e..519008dc 100644 --- a/keystone/test.py +++ b/keystone/test.py @@ -19,6 +19,7 @@ import subprocess import sys import time +import eventlet import mox from paste import deploy import stubout @@ -32,8 +33,12 @@ from keystone import config from keystone.openstack.common import importutils +do_monkeypatch = not os.getenv('STANDARD_THREADS') +eventlet.patcher.monkey_patch(all=False, socket=True, time=True, + thread=do_monkeypatch) + LOG = logging.getLogger(__name__) -ROOTDIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +ROOTDIR = os.path.dirname(os.path.abspath(os.curdir)) VENDOR = os.path.join(ROOTDIR, 'vendor') TESTSDIR = os.path.join(ROOTDIR, 'tests') ETCDIR = os.path.join(ROOTDIR, 'etc') -- cgit