diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000000..a2ff14b27f --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/heat/tests/__init__.py b/heat/tests/__init__.py index b273fb4a2e..d89db057e1 100644 --- a/heat/tests/__init__.py +++ b/heat/tests/__init__.py @@ -16,21 +16,3 @@ # The code below enables nosetests to work with i18n _() blocks import __builtin__ setattr(__builtin__, '_', lambda x: x) - -import os - -from heat.db.sqlalchemy.session import get_engine - - -def reset_db(): - if os.path.exists('heat-test.db'): - os.remove('heat-test.db') - - -def setup(): - from heat.db import migration - - reset_db() - migration.db_sync() - engine = get_engine() - conn = engine.connect() diff --git a/heat/tests/functional/__init__.py b/heat/tests/functional/__init__.py deleted file mode 100644 index 13cd5bb111..0000000000 --- a/heat/tests/functional/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. diff --git a/heat/tests/test_autoscaling.py b/heat/tests/test_autoscaling.py index ab8576d499..de28c6edd1 100644 --- a/heat/tests/test_autoscaling.py +++ b/heat/tests/test_autoscaling.py @@ -32,6 +32,7 @@ from heat.engine import parser from heat.engine import scheduler from heat.engine.resource import Metadata from heat.openstack.common import timeutils +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource']) @@ -39,10 +40,10 @@ from heat.openstack.common import timeutils class AutoScalingTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "AutoScalingTest teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_eip.py b/heat/tests/test_eip.py index 068a4dd4df..9007d34436 100644 --- a/heat/tests/test_eip.py +++ b/heat/tests/test_eip.py @@ -26,6 +26,7 @@ from heat.engine.resources import eip from heat.engine import parser from heat.engine import scheduler from heat.tests.v1_1 import fakes +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource']) @@ -37,10 +38,10 @@ class EIPTest(unittest.TestCase): self.m.StubOutWithMock(eip.ElasticIp, 'nova') self.m.StubOutWithMock(eip.ElasticIpAssociation, 'nova') self.m.StubOutWithMock(self.fc.servers, 'get') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "EIPTest teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_engine_service.py b/heat/tests/test_engine_service.py index b61942729c..cd2d473ff9 100644 --- a/heat/tests/test_engine_service.py +++ b/heat/tests/test_engine_service.py @@ -34,6 +34,7 @@ from heat.engine.properties import Properties from heat.engine.resources import instance as instances from heat.engine import watchrule from heat.openstack.common import threadgroup +from heat.tests.utils import setup_dummy_db tests_dir = os.path.dirname(os.path.realpath(__file__)) @@ -108,10 +109,10 @@ class DummyThreadGroup(object): class stackCreateTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "stackTest teardown complete" def test_wordpress_single_instance_stack_create(self): stack = get_wordpress_stack('test_stack', create_context(self.m)) @@ -158,6 +159,7 @@ class stackServiceCreateUpdateDeleteTest(unittest.TestCase): self.m = mox.Mox() self.username = 'stack_service_create_test_user' self.tenant = 'stack_service_create_test_tenant' + setup_dummy_db() self.ctx = create_context(self.m, self.username, self.tenant) self.man = service.EngineService('a-host', 'a-topic') @@ -436,6 +438,7 @@ class stackServiceTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() + setup_dummy_db() self.ctx = create_context(self.m, self.username, self.tenant) setup_mocks(self.m, self.stack) self.m.ReplayAll() diff --git a/heat/tests/test_event.py b/heat/tests/test_event.py index 580af8339a..0408837768 100644 --- a/heat/tests/test_event.py +++ b/heat/tests/test_event.py @@ -24,6 +24,7 @@ from heat.engine import resource from heat.engine import template from heat.engine import event +from heat.tests.utils import setup_dummy_db from heat.tests import generic_resource as generic_rsrc @@ -46,6 +47,7 @@ class EventTest(unittest.TestCase): self.m = mox.Mox() + setup_dummy_db() self.ctx = context.get_admin_context() self.m.StubOutWithMock(self.ctx, 'username') self.ctx.username = self.username diff --git a/heat/tests/test_instance.py b/heat/tests/test_instance.py index 319e029477..25f726ead0 100644 --- a/heat/tests/test_instance.py +++ b/heat/tests/test_instance.py @@ -27,6 +27,7 @@ from heat.common import template_format from heat.engine import parser from heat.engine import scheduler from heat.openstack.common import uuidutils +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource', 'instance']) @@ -37,10 +38,10 @@ class instancesTest(unittest.TestCase): self.fc = fakes.FakeClient() self.path = os.path.dirname(os.path.realpath(__file__)).\ replace('heat/tests', 'templates') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "instancesTest teardown complete" def test_instance_create(self): f = open("%s/WordPress_Single_Instance_gold.template" % self.path) diff --git a/heat/tests/test_instance_group.py b/heat/tests/test_instance_group.py index 4334e03056..e244b0c4eb 100644 --- a/heat/tests/test_instance_group.py +++ b/heat/tests/test_instance_group.py @@ -30,6 +30,7 @@ from heat.engine.resources import instance from heat.engine.resources import loadbalancer from heat.engine import parser from heat.engine import scheduler +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource']) @@ -39,10 +40,10 @@ class InstanceGroupTest(unittest.TestCase): self.fc = fakes.FakeClient() self.m = mox.Mox() self.m.StubOutWithMock(loadbalancer.LoadBalancer, 'reload') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "InstanceGroupTest teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_loadbalancer.py b/heat/tests/test_loadbalancer.py index 6910360528..518af1f3c3 100644 --- a/heat/tests/test_loadbalancer.py +++ b/heat/tests/test_loadbalancer.py @@ -33,6 +33,7 @@ from heat.engine.resources import user from heat.engine.resources import loadbalancer as lb from heat.engine.resources import wait_condition as wc from heat.engine.resource import Metadata +from heat.tests.utils import setup_dummy_db from heat.tests.v1_1 import fakes from heat.tests import fakes as test_fakes @@ -63,6 +64,7 @@ class LoadBalancerTest(unittest.TestCase): cfg.CONF.set_default('heat_waitcondition_server_url', 'http://127.0.0.1:8000/v1/waitcondition') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() diff --git a/heat/tests/test_metadata_refresh.py b/heat/tests/test_metadata_refresh.py index ddaffe3501..af62d5c680 100644 --- a/heat/tests/test_metadata_refresh.py +++ b/heat/tests/test_metadata_refresh.py @@ -21,6 +21,7 @@ from nose.plugins.attrib import attr from oslo.config import cfg from heat.tests import fakes +from heat.tests.utils import setup_dummy_db from heat.tests.utils import stack_delete_after from heat.common import identifier @@ -129,6 +130,7 @@ class MetadataRefreshTest(unittest.TestCase): self.m = mox.Mox() self.m.StubOutWithMock(eventlet, 'sleep') self.fc = fakes.FakeKeystoneClient() + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() @@ -189,6 +191,7 @@ class MetadataRefreshTest(unittest.TestCase): class WaitCondMetadataUpdateTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() + setup_dummy_db() self.ctx = context.get_admin_context() self.ctx.tenant_id = 'test_tenant' self.fc = fakes.FakeKeystoneClient() diff --git a/heat/tests/test_nested_stack.py b/heat/tests/test_nested_stack.py index 6568540b80..f2bb96b20e 100644 --- a/heat/tests/test_nested_stack.py +++ b/heat/tests/test_nested_stack.py @@ -24,6 +24,7 @@ from heat.common import template_format from heat.engine import parser from heat.engine.resources import stack as nested_stack from heat.common import urlfetch +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource']) @@ -50,6 +51,7 @@ Outputs: def setUp(self): self.m = mox.Mox() self.m.StubOutWithMock(urlfetch, 'get') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() diff --git a/heat/tests/test_nokey.py b/heat/tests/test_nokey.py index 009bcaff1b..449f7d476c 100644 --- a/heat/tests/test_nokey.py +++ b/heat/tests/test_nokey.py @@ -26,6 +26,7 @@ from heat.common import template_format from heat.engine import parser from heat.engine import scheduler from heat.openstack.common import uuidutils +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource', 'instance']) @@ -36,10 +37,10 @@ class nokeyTest(unittest.TestCase): self.fc = fakes.FakeClient() self.path = os.path.dirname(os.path.realpath(__file__)).\ replace('heat/tests', 'templates') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "nokeyTest teardown complete" def test_nokey_create(self): f = open("%s/WordPress_NoKey.template" % self.path) diff --git a/heat/tests/test_parser.py b/heat/tests/test_parser.py index 04f9cac8ca..0946919c46 100644 --- a/heat/tests/test_parser.py +++ b/heat/tests/test_parser.py @@ -26,6 +26,7 @@ from heat.engine import parser from heat.engine import parameters from heat.engine import template +from heat.tests.utils import setup_dummy_db from heat.tests.utils import stack_delete_after from heat.tests import generic_resource as generic_rsrc @@ -300,6 +301,7 @@ class StackTest(unittest.TestCase): self.m = mox.Mox() + setup_dummy_db() self.ctx = context.get_admin_context() self.m.StubOutWithMock(self.ctx, 'username') self.ctx.username = self.username diff --git a/heat/tests/test_quantum.py b/heat/tests/test_quantum.py index 6ae8e72ae0..5b360cfd03 100644 --- a/heat/tests/test_quantum.py +++ b/heat/tests/test_quantum.py @@ -31,6 +31,7 @@ from heat.engine.resources.quantum import floatingip from heat.engine.resources.quantum import port from heat.engine.resources.quantum.quantum import QuantumResource as qr from heat.engine import parser +from heat.tests.utils import setup_dummy_db class FakeQuantum(): @@ -103,10 +104,10 @@ class QuantumTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() self.m.StubOutWithMock(net.Net, 'quantum') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "QuantumTest teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ @@ -211,6 +212,7 @@ class QuantumFloatingIPTest(unittest.TestCase): self.m.StubOutWithMock(floatingip.FloatingIP, 'quantum') self.m.StubOutWithMock(floatingip.FloatingIPAssociation, 'quantum') self.m.StubOutWithMock(port.Port, 'quantum') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py index 690f30aebb..19e7b17d6f 100644 --- a/heat/tests/test_resource.py +++ b/heat/tests/test_resource.py @@ -25,6 +25,7 @@ from heat.engine import scheduler from heat.openstack.common import uuidutils from heat.tests import generic_resource as generic_rsrc +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource']) @@ -32,6 +33,7 @@ from heat.tests import generic_resource as generic_rsrc class ResourceTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() + setup_dummy_db() self.stack = parser.Stack(None, 'test_stack', parser.Template({}), stack_id=uuidutils.generate_uuid()) @@ -322,6 +324,7 @@ class MetadataTest(unittest.TestCase): 'Type': 'Foo', 'Metadata': {'Test': 'Initial metadata'} } + setup_dummy_db() ctx = context.get_admin_context() self.m.StubOutWithMock(ctx, 'username') ctx.username = 'metadata_test_user' diff --git a/heat/tests/test_s3.py b/heat/tests/test_s3.py index 24dc5ec1f0..95cb60c7ca 100644 --- a/heat/tests/test_s3.py +++ b/heat/tests/test_s3.py @@ -27,7 +27,8 @@ from heat.openstack.common.importutils import try_import from heat.engine.resources import s3 from heat.engine import parser from heat.engine import scheduler -from utils import skip_if +from heat.tests.utils import setup_dummy_db +from heat.tests.utils import skip_if swiftclient = try_import('swiftclient.client') @@ -44,10 +45,10 @@ class s3Test(unittest.TestCase): self.m.StubOutWithMock(swiftclient.Connection, 'get_auth') self.container_pattern = 'test_stack-test_resource-[0-9a-z]+' + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "s3Test teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_security_group.py b/heat/tests/test_security_group.py index be3328e51e..3d17f78c90 100644 --- a/heat/tests/test_security_group.py +++ b/heat/tests/test_security_group.py @@ -22,6 +22,7 @@ from heat.engine import clients from heat.common import context from heat.common import template_format from heat.engine import parser +from heat.tests.utils import setup_dummy_db from heat.tests.v1_1 import fakes from novaclient.v1_1 import security_groups as nova_sg @@ -68,6 +69,7 @@ Resources: self.m.StubOutWithMock(nova_sg.SecurityGroupManager, 'delete') self.m.StubOutWithMock(nova_sg.SecurityGroupManager, 'get') self.m.StubOutWithMock(nova_sg.SecurityGroupManager, 'list') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() diff --git a/heat/tests/test_swift.py b/heat/tests/test_swift.py index c9cb2c448d..472ba2a224 100644 --- a/heat/tests/test_swift.py +++ b/heat/tests/test_swift.py @@ -27,6 +27,7 @@ from heat.openstack.common.importutils import try_import from heat.engine.resources import swift from heat.engine import parser from heat.engine import scheduler +from heat.tests.utils import setup_dummy_db from heat.tests.utils import skip_if swiftclient = try_import('swiftclient.client') @@ -45,10 +46,10 @@ class swiftTest(unittest.TestCase): self.m.StubOutWithMock(swiftclient.Connection, 'get_auth') self.container_pattern = 'test_stack-test_resource-[0-9a-z]+' + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "swiftTest teardown complete" def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_template_format.py b/heat/tests/test_template_format.py index c92fdeb653..6c0e28c711 100644 --- a/heat/tests/test_template_format.py +++ b/heat/tests/test_template_format.py @@ -21,6 +21,7 @@ from heat.engine import clients from heat.common import context from heat.common import template_format from heat.engine import parser +from heat.tests.utils import setup_dummy_db @attr(tag=['unit']) @@ -99,6 +100,7 @@ class JsonYamlResolvedCompareTest(unittest.TestCase): def setUp(self): self.longMessage = True self.maxDiff = None + setup_dummy_db() def load_template(self, file_name): self.path = os.path.dirname(os.path.realpath(__file__)).\ diff --git a/heat/tests/test_user.py b/heat/tests/test_user.py index 10046b21cc..bfc757d04d 100644 --- a/heat/tests/test_user.py +++ b/heat/tests/test_user.py @@ -28,22 +28,26 @@ from heat.engine import parser from heat.engine import scheduler from heat.engine.resources import user from heat.tests import fakes +from heat.tests.utils import setup_dummy_db import keystoneclient.exceptions -@attr(tag=['unit', 'resource', 'User']) -@attr(speed='fast') -class UserTest(unittest.TestCase): +class UserPolicyTestCase(unittest.TestCase): def setUp(self): config.register_engine_opts() self.m = mox.Mox() self.fc = fakes.FakeKeystoneClient(username='test_stack.CfnUser') cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "UserTest teardown complete" + + +@attr(tag=['unit', 'resource', 'User']) +@attr(speed='fast') +class UserTest(UserPolicyTestCase): def load_template(self, template_name='Rails_Single_Instance.template'): self.path = os.path.dirname(os.path.realpath(__file__)).\ @@ -226,16 +230,7 @@ class UserTest(unittest.TestCase): @attr(tag=['unit', 'resource', 'AccessKey']) @attr(speed='fast') -class AccessKeyTest(unittest.TestCase): - def setUp(self): - config.register_engine_opts() - self.m = mox.Mox() - self.fc = fakes.FakeKeystoneClient(username='test_stack.CfnUser') - cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role') - - def tearDown(self): - self.m.UnsetStubs() - print "AccessKey teardown complete" +class AccessKeyTest(UserPolicyTestCase): def load_template(self): self.path = os.path.dirname(os.path.realpath(__file__)).\ @@ -345,15 +340,7 @@ class AccessKeyTest(unittest.TestCase): @attr(tag=['unit', 'resource', 'AccessPolicy']) @attr(speed='fast') -class AccessPolicyTest(unittest.TestCase): - def setUp(self): - self.m = mox.Mox() - self.fc = fakes.FakeKeystoneClient(username='test_stack.CfnUser') - cfg.CONF.set_default('heat_stack_user_role', 'stack_user_role') - - def tearDown(self): - self.m.UnsetStubs() - print "UserTest teardown complete" +class AccessPolicyTest(UserPolicyTestCase): def load_template(self): template_name =\ diff --git a/heat/tests/test_validate.py b/heat/tests/test_validate.py index 480bfe35df..70ee035f22 100644 --- a/heat/tests/test_validate.py +++ b/heat/tests/test_validate.py @@ -25,6 +25,7 @@ from heat.engine.resources import instance as instances from heat.engine import service import heat.db.api as db_api from heat.engine import parser +from heat.tests.utils import setup_dummy_db test_template_volumeattach = ''' { @@ -272,10 +273,10 @@ class validateTest(unittest.TestCase): def setUp(self): self.m = mox.Mox() self.fc = fakes.FakeClient() + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() - print "volumeTest teardown complete" def test_validate_volumeattach_valid(self): t = template_format.parse(test_template_volumeattach % 'vdq') @@ -311,7 +312,6 @@ class validateTest(unittest.TestCase): engine = service.EngineService('a', 't') res = dict(engine.validate_template(None, t)) - print 'res %s' % res self.assertEqual(res['Description'], 'test.') def test_validate_ref_invalid(self): diff --git a/heat/tests/test_volume.py b/heat/tests/test_volume.py index cec9ff4bd7..5cc39bb55a 100644 --- a/heat/tests/test_volume.py +++ b/heat/tests/test_volume.py @@ -29,6 +29,7 @@ from heat.engine import scheduler from heat.engine.resources import volume as vol from heat.engine import clients from heat.tests.v1_1 import fakes +from heat.tests.utils import setup_dummy_db @attr(tag=['unit', 'resource', 'volume']) @@ -45,6 +46,7 @@ class VolumeTest(unittest.TestCase): self.m.StubOutWithMock(self.fc.volumes, 'create_server_volume') self.m.StubOutWithMock(self.fc.volumes, 'delete_server_volume') self.m.StubOutWithMock(eventlet, 'sleep') + setup_dummy_db() def tearDown(self): self.m.UnsetStubs() diff --git a/heat/tests/test_vpc.py b/heat/tests/test_vpc.py index 1e80e989d2..c27f18524f 100644 --- a/heat/tests/test_vpc.py +++ b/heat/tests/test_vpc.py @@ -22,6 +22,7 @@ from heat.common import context from heat.common import exception from heat.common import template_format from heat.engine import parser +from heat.tests.utils import setup_dummy_db try: from quantumclient.common.exceptions import QuantumClientException @@ -34,6 +35,7 @@ except ImportError: class VPCTestBase(unittest.TestCase): def setUp(self): + setup_dummy_db() self.m = mox.Mox() self.m.StubOutWithMock(quantumclient.Client, 'add_interface_router') self.m.StubOutWithMock(quantumclient.Client, 'add_gateway_router') diff --git a/heat/tests/test_waitcondition.py b/heat/tests/test_waitcondition.py index c211df0736..a006e40d2a 100644 --- a/heat/tests/test_waitcondition.py +++ b/heat/tests/test_waitcondition.py @@ -25,6 +25,7 @@ import unittest from heat.tests import fakes from heat.tests.utils import stack_delete_after +from heat.tests.utils import setup_dummy_db import heat.db.api as db_api from heat.common import template_format @@ -79,8 +80,10 @@ test_template_wc_count = ''' @attr(tag=['unit', 'resource', 'WaitCondition']) @attr(speed='slow') class WaitConditionTest(unittest.TestCase): + def setUp(self): config.register_engine_opts() + setup_dummy_db() self.m = mox.Mox() self.m.StubOutWithMock(wc.WaitConditionHandle, 'get_status') @@ -389,6 +392,7 @@ class WaitConditionHandleTest(unittest.TestCase): 'http://127.0.0.1:8000/v1/waitcondition') self.fc = fakes.FakeKeystoneClient() + setup_dummy_db() self.stack = self.create_stack() def tearDown(self): diff --git a/heat/tests/test_watch.py b/heat/tests/test_watch.py index 7a0162d4a4..1e134c1af8 100644 --- a/heat/tests/test_watch.py +++ b/heat/tests/test_watch.py @@ -23,6 +23,7 @@ import heat.db.api as db_api from heat.openstack.common import timeutils from heat.engine import watchrule from heat.engine import parser +from heat.tests import utils class WatchData: @@ -44,6 +45,7 @@ class WatchRuleTest(unittest.TestCase): def setUpClass(cls): # Create a dummy stack in the DB as WatchRule instances # must be associated with a stack + utils.setup_dummy_db() ctx = context.get_admin_context() ctx.username = 'dummyuser' ctx.tenant_id = '123456' diff --git a/heat/tests/utils.py b/heat/tests/utils.py index fa5c7d4fa0..93056a895a 100644 --- a/heat/tests/utils.py +++ b/heat/tests/utils.py @@ -14,6 +14,8 @@ import nose.plugins.skip as skip +from heat.db.sqlalchemy.session import get_engine +from heat.db import migration class skip_test(object): @@ -70,7 +72,7 @@ def stack_delete_after(test_fn): to ensure tests clean up their stacks regardless of test success/failure """ def wrapped_test(test_cls): - print "Running test", test_fn.__name__ + #print "Running test", test_fn.__name__ try: test_fn(test_cls) finally: @@ -78,5 +80,11 @@ def stack_delete_after(test_fn): test_cls.stack.delete() except AttributeError: print "Could not delete stack (already deleted?)" - print "Exited", test_fn.__name__ + #print "Exited", test_fn.__name__ return wrapped_test + + +def setup_dummy_db(): + migration.db_sync() + engine = get_engine() + conn = engine.connect()