summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/functions.py14
-rw-r--r--test/sql/testtypes.py30
2 files changed, 33 insertions, 11 deletions
diff --git a/test/sql/functions.py b/test/sql/functions.py
index 681d6a557..27e87eceb 100644
--- a/test/sql/functions.py
+++ b/test/sql/functions.py
@@ -5,22 +5,16 @@ from sqlalchemy.sql import table, column
from sqlalchemy import databases, sql, util
from sqlalchemy.sql.compiler import BIND_TEMPLATES
from sqlalchemy.engine import default
+from testlib.engines import all_dialects
from sqlalchemy import types as sqltypes
from testlib import *
from sqlalchemy.sql.functions import GenericFunction
from testlib.testing import eq_
from sqlalchemy.databases import *
-# every dialect in databases.__all__ is expected to pass these tests.
-dialects = [getattr(databases, mod).dialect()
- for mod in databases.__all__
- # fixme!
- if mod not in ('access',)]
-
-# if the configured dialect is out-of-tree or not yet in __all__, include it
-# too.
-if testing.db.name not in databases.__all__:
- dialects.append(testing.db.dialect)
+
+# FIXME!
+dialects = [d for d in all_dialects() if d.name not in ('access', 'informix')]
class CompileTest(TestBase, AssertsCompiledSQL):
diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py
index eaeac326b..345fbceac 100644
--- a/test/sql/testtypes.py
+++ b/test/sql/testtypes.py
@@ -4,6 +4,7 @@ import datetime, os, pickleable, re
from sqlalchemy import *
from sqlalchemy import exc, types, util
from sqlalchemy.sql import operators
+from testlib.testing import eq_
import sqlalchemy.engine.url as url
from sqlalchemy.databases import mssql, oracle, mysql, postgres, firebird
from testlib import *
@@ -728,7 +729,34 @@ class NumericTest(TestBase, AssertsExecutionResults):
assert isinstance(row['ncasdec'], decimal.Decimal)
assert isinstance(row['fcasdec'], decimal.Decimal)
-
+ def test_length_deprecation(self):
+ self.assertRaises(exc.SADeprecationWarning, Numeric, length=8)
+
+ @testing.uses_deprecated(".*is deprecated for Numeric")
+ def go():
+ n = Numeric(length=12)
+ assert n.scale == 12
+ go()
+
+ n = Numeric(scale=12)
+ for dialect in engines.all_dialects():
+ n2 = dialect.type_descriptor(n)
+ eq_(n2.scale, 12, dialect.name)
+
+ # test colspec generates successfully using 'scale'
+ assert n2.get_col_spec()
+
+ # test constructor of the dialect-specific type
+ n3 = n2.__class__(scale=5)
+ eq_(n3.scale, 5, dialect.name)
+
+ @testing.uses_deprecated(".*is deprecated for Numeric")
+ def go():
+ n3 = n2.__class__(length=6)
+ eq_(n3.scale, 6, dialect.name)
+ go()
+
+
class IntervalTest(TestBase, AssertsExecutionResults):
def setUpAll(self):
global interval_table, metadata