From: Philip Jenvey Date: Sun, 19 Jul 2009 06:36:20 +0000 (+0000) Subject: skip sqlite tests when it's not available X-Git-Tag: rel_0_6_6~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69f9800ab094e073b97f760405f9b516305bd648;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git skip sqlite tests when it's not available --- diff --git a/test/engine/test_ddlevents.py b/test/engine/test_ddlevents.py index 5343fb2c9f..434a5d873c 100644 --- a/test/engine/test_ddlevents.py +++ b/test/engine/test_ddlevents.py @@ -7,6 +7,7 @@ from sqlalchemy.test.schema import Column import sqlalchemy as tsa from sqlalchemy.test import TestBase, testing, engines from sqlalchemy.test.testing import AssertsCompiledSQL +from nose import SkipTest class DDLEventTest(TestBase): class Canary(object): @@ -281,7 +282,10 @@ class DDLExecutionTest(TestBase): assert 'fnord' in strings def test_ddl_execute(self): - engine = create_engine('sqlite:///') + try: + engine = create_engine('sqlite:///') + except ImportError: + raise SkipTest('Requires sqlite') cx = engine.connect() table = self.users ddl = DDL('SELECT 1') diff --git a/test/orm/sharding/test_shard.py b/test/orm/sharding/test_shard.py index 89e23fb759..e8ffaa7cad 100644 --- a/test/orm/sharding/test_shard.py +++ b/test/orm/sharding/test_shard.py @@ -6,6 +6,7 @@ from sqlalchemy.orm.shard import ShardedSession from sqlalchemy.sql import operators from sqlalchemy.test import * from sqlalchemy.test.testing import eq_ +from nose import SkipTest # TODO: ShardTest can be turned into a base for further subclasses @@ -14,7 +15,10 @@ class ShardTest(TestBase): def setup_class(cls): global db1, db2, db3, db4, weather_locations, weather_reports - db1 = create_engine('sqlite:///shard1.db') + try: + db1 = create_engine('sqlite:///shard1.db') + except ImportError: + raise SkipTest('Requires sqlite') db2 = create_engine('sqlite:///shard2.db') db3 = create_engine('sqlite:///shard3.db') db4 = create_engine('sqlite:///shard4.db')