summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-08-29 12:36:54 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-08-31 17:20:26 -0400
commit2efd89d02941ab4267d6e2842963fd38b1539f6c (patch)
treec9346b13726a84ceab1a5c0d819ff236e1c7c22c /test/sql
parentde73c6d1cd880b213f87723b6cf73fea20a7b9fb (diff)
downloadsqlalchemy-2efd89d02941ab4267d6e2842963fd38b1539f6c.tar.gz
Add SQL Server CI coverage
Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_defaults.py3
-rw-r--r--test/sql/test_insert_exec.py1
-rw-r--r--test/sql/test_query.py4
-rw-r--r--test/sql/test_resultset.py1
-rw-r--r--test/sql/test_types.py22
5 files changed, 20 insertions, 11 deletions
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py
index 3c4ccc050..1ef49bf04 100644
--- a/test/sql/test_defaults.py
+++ b/test/sql/test_defaults.py
@@ -634,12 +634,15 @@ class CTEDefaultTest(fixtures.TablesTest):
expected
)
+ @testing.requires.ctes_on_dml
def test_update_in_select(self):
self._test_a_in_b("update", "select")
+ @testing.requires.ctes_on_dml
def test_delete_in_select(self):
self._test_a_in_b("update", "select")
+ @testing.requires.ctes_on_dml
def test_insert_in_select(self):
self._test_a_in_b("update", "select")
diff --git a/test/sql/test_insert_exec.py b/test/sql/test_insert_exec.py
index 6015f4e74..502ef6912 100644
--- a/test/sql/test_insert_exec.py
+++ b/test/sql/test_insert_exec.py
@@ -158,6 +158,7 @@ class InsertExecTest(fixtures.TablesTest):
{'id': 'hi', 'foo': 'thisisfoo', 'bar': "thisisbar"}
)
+ @testing.requires.sequences
def test_lastrow_accessor_four(self):
metadata = MetaData()
self._test_lastrow_accessor(
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 28300855f..afb113748 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -503,9 +503,7 @@ class QueryTest(fixtures.TestBase):
@testing.fails_on('firebird', "uses sql-92 rules")
@testing.fails_on('sybase', "uses sql-92 rules")
- @testing.fails_if(
- lambda: testing.against('mssql+pyodbc') and not
- testing.db.dialect.freetds, "uses sql-92 rules")
+ @testing.skip_if(['mssql'])
def test_bind_in(self):
"""test calling IN against a bind parameter.
diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py
index 48fe28861..41092efe9 100644
--- a/test/sql/test_resultset.py
+++ b/test/sql/test_resultset.py
@@ -523,6 +523,7 @@ class ResultProxyTest(fixtures.TablesTest):
eq_(result.fetchone(), None)
assert connection.closed
+ @testing.requires.updateable_autoincrement_pks
def test_connectionless_autoclose_no_metadata(self):
result = testing.db.execute("update users set user_id=5")
connection = result.connection
diff --git a/test/sql/test_types.py b/test/sql/test_types.py
index fdcf53c27..b6cc04322 100644
--- a/test/sql/test_types.py
+++ b/test/sql/test_types.py
@@ -344,13 +344,18 @@ class UserDefinedTest(fixtures.TablesTest, AssertsCompiledSQL):
def get_col_spec(self):
return "BAR"
+ t = Table('t', MetaData(), Column('bar', MyType, nullable=False))
+
self.assert_compile(
- ddl.CreateColumn(Column('bar', MyType)),
- "bar FOOB bar"
+ ddl.CreateColumn(t.c.bar),
+ "bar FOOB bar NOT NULL"
)
+
+ t = Table('t', MetaData(),
+ Column('bar', MyOtherType, nullable=False))
self.assert_compile(
- ddl.CreateColumn(Column('bar', MyOtherType)),
- "bar BAR"
+ ddl.CreateColumn(t.c.bar),
+ "bar BAR NOT NULL"
)
def test_typedecorator_literal_render_fallback_bound(self):
@@ -1165,7 +1170,7 @@ class EnumTest(AssertsCompiledSQL, fixtures.TablesTest):
Table(
'non_native_enum_table', metadata,
- Column("id", Integer, primary_key=True),
+ Column("id", Integer, primary_key=True, autoincrement=False),
Column('someenum', Enum('one', 'two', 'three', native_enum=False)),
Column('someotherenum',
Enum('one', 'two', 'three',
@@ -1369,7 +1374,7 @@ class EnumTest(AssertsCompiledSQL, fixtures.TablesTest):
@testing.requires.enforces_check_constraints
def test_check_constraint(self):
assert_raises(
- (exc.IntegrityError, exc.ProgrammingError),
+ (exc.IntegrityError, exc.ProgrammingError, exc.OperationalError),
testing.db.execute,
"insert into non_native_enum_table "
"(id, someenum) values(1, 'four')")
@@ -1614,6 +1619,7 @@ class BinaryTest(fixtures.TestBase, AssertsExecutionResults):
def teardown_class(cls):
metadata.drop_all()
+ @testing.requires.non_broken_binary
def test_round_trip(self):
testobj1 = pickleable.Foo('im foo 1')
testobj2 = pickleable.Foo('im foo 2')
@@ -2399,10 +2405,10 @@ class TestKWArgPassThru(AssertsCompiledSQL, fixtures.TestBase):
return "FOOB %s" % kw['type_expression'].name
m = MetaData()
- t = Table('t', m, Column('bar', MyType))
+ t = Table('t', m, Column('bar', MyType, nullable=False))
self.assert_compile(
ddl.CreateColumn(t.c.bar),
- "bar FOOB bar"
+ "bar FOOB bar NOT NULL"
)