summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2012-02-12 20:00:44 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2012-02-12 20:00:44 -0500
commit04c7bae3080801482caabfb0c4e4525759a388eb (patch)
tree5c3504bc56209c1859f6990d4a74e49cb2224bba
parentc6278444aa58f74c9373823b8dc4eebc6a21b2f1 (diff)
downloadsqlalchemy-04c7bae3080801482caabfb0c4e4525759a388eb.tar.gz
- test failures. one in particular seems to be a weird oursql bug, oh well
-rw-r--r--test/dialect/test_oracle.py40
-rw-r--r--test/engine/test_execute.py2
-rw-r--r--test/sql/test_labels.py7
3 files changed, 28 insertions, 21 deletions
diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py
index 683029549..9540fa963 100644
--- a/test/dialect/test_oracle.py
+++ b/test/dialect/test_oracle.py
@@ -725,6 +725,19 @@ class DialectTypesTest(fixtures.TestBase, AssertsCompiledSQL):
]:
self.assert_compile(typ, exp, dialect=dialect)
+ def test_interval(self):
+ for type_, expected in [(oracle.INTERVAL(),
+ 'INTERVAL DAY TO SECOND'),
+ (oracle.INTERVAL(day_precision=3),
+ 'INTERVAL DAY(3) TO SECOND'),
+ (oracle.INTERVAL(second_precision=5),
+ 'INTERVAL DAY TO SECOND(5)'),
+ (oracle.INTERVAL(day_precision=2,
+ second_precision=5),
+ 'INTERVAL DAY(2) TO SECOND(5)')]:
+ self.assert_compile(type_, expected)
+
+
class TypesTest(fixtures.TestBase):
__only_on__ = 'oracle'
__dialect__ = oracle.OracleDialect()
@@ -802,33 +815,21 @@ class TypesTest(fixtures.TestBase):
@testing.fails_on('+zxjdbc',
'Not yet known how to pass values of the '
'INTERVAL type')
+ @testing.provide_metadata
def test_interval(self):
- for type_, expected in [(oracle.INTERVAL(),
- 'INTERVAL DAY TO SECOND'),
- (oracle.INTERVAL(day_precision=3),
- 'INTERVAL DAY(3) TO SECOND'),
- (oracle.INTERVAL(second_precision=5),
- 'INTERVAL DAY TO SECOND(5)'),
- (oracle.INTERVAL(day_precision=2,
- second_precision=5),
- 'INTERVAL DAY(2) TO SECOND(5)')]:
- self.assert_compile(type_, expected)
- metadata = MetaData(testing.db)
+ metadata = self.metadata
interval_table = Table('intervaltable', metadata, Column('id',
Integer, primary_key=True,
test_needs_autoincrement=True),
Column('day_interval',
oracle.INTERVAL(day_precision=3)))
metadata.create_all()
- try:
- interval_table.insert().\
- execute(day_interval=datetime.timedelta(days=35,
- seconds=5743))
- row = interval_table.select().execute().first()
- eq_(row['day_interval'], datetime.timedelta(days=35,
+ interval_table.insert().\
+ execute(day_interval=datetime.timedelta(days=35,
seconds=5743))
- finally:
- metadata.drop_all()
+ row = interval_table.select().execute().first()
+ eq_(row['day_interval'], datetime.timedelta(days=35,
+ seconds=5743))
def test_numerics(self):
m = MetaData(testing.db)
@@ -1266,6 +1267,7 @@ class UnsupportedIndexReflectTest(fixtures.TestBase):
def teardown(self):
metadata.drop_all()
+ @testing.emits_warning("No column names")
def test_reflect_functional_index(self):
testing.db.execute('CREATE INDEX DATA_IDX ON '
'TEST_INDEX_REFLECT (UPPER(DATA))')
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index 46173d561..f3206e9cc 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -403,8 +403,10 @@ class ConvenienceExecuteTest(fixtures.TablesTest):
# autocommit is on
self._assert_fn(5, value=8)
+ @testing.fails_on('mysql+oursql', "oursql bug ? getting wrong rowcount")
def test_connect_as_ctx_noautocommit(self):
fn = self._trans_fn()
+ self._assert_no_data()
ctx = testing.db.connect().execution_options(autocommit=False)
testing.run_as_contextmanager(ctx, fn, 5, value=8)
# autocommit is off
diff --git a/test/sql/test_labels.py b/test/sql/test_labels.py
index ad4727b9b..7c65a1d01 100644
--- a/test/sql/test_labels.py
+++ b/test/sql/test_labels.py
@@ -5,6 +5,7 @@ from sqlalchemy import *
from sqlalchemy import exc as exceptions
from sqlalchemy.engine import default
from sqlalchemy.sql import table, column
+from test.lib.schema import Table, Column
IDENT_LENGTH = 29
@@ -26,13 +27,15 @@ class LongLabelsTest(fixtures.TablesTest, AssertsCompiledSQL):
def define_tables(cls, metadata):
table1 = Table("some_large_named_table", metadata,
Column("this_is_the_primarykey_column", Integer,
- primary_key=True),
+ primary_key=True,
+ test_needs_autoincrement=True),
Column("this_is_the_data_column", String(30))
)
table2 = Table("table_with_exactly_29_characs", metadata,
Column("this_is_the_primarykey_column", Integer,
- primary_key=True),
+ primary_key=True,
+ test_needs_autoincrement=True),
Column("this_is_the_data_column", String(30))
)
cls.tables.table1 = table1