Skip to content

Commit edcf4b1

Browse files
committed
fix testsuite running for sqlalchemy >= 1.2
1 parent 692e35b commit edcf4b1

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

sqlalchemy_monetdb/requirements.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,19 @@ def parens_in_union_contained_select_wo_limit_offset(self):
139139
https://www.monetdb.org/bugzilla/show_bug.cgi?id=6434
140140
141141
"""
142+
return exclusions.closed()
143+
144+
@property
145+
def order_by_col_from_union(self):
146+
"""target database supports ordering by a column from a SELECT
147+
inside of a UNION
148+
E.g. (SELECT id, ...) UNION (SELECT id, ...) ORDER BY id
149+
Fails on SQL Server
150+
151+
This is also unsupported by MonetDB
152+
"""
153+
return exclusions.closed()
154+
155+
@property
156+
def broken_cx_oracle6_numerics(config):
142157
return exclusions.closed()

test/test_suite.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sqlalchemy as sa
22
from sqlalchemy.testing.suite import *
33
from sqlalchemy.testing.suite import ComponentReflectionTest as _ComponentReflectionTest
4-
from sqlalchemy.testing.suite import CompoundSelectTest as _CompoundSelectTest
4+
55
from sqlalchemy import inspect
66
from sqlalchemy.testing import eq_
77
from sqlalchemy import testing
@@ -10,6 +10,16 @@
1010
from sqlalchemy import MetaData
1111

1212

13+
# SQLAlchemy < 1.1 doesn't implement CompoundSelectTest
14+
from sqlalchemy import __version__
15+
major, minor = [int(i) for i in __version__.split('.')[:2]]
16+
if major < 1 or (major == 1 and minor < 1):
17+
class _CompoundSelectTest:
18+
pass
19+
else:
20+
from sqlalchemy.testing.suite import CompoundSelectTest as _CompoundSelectTest
21+
22+
1323
class ComponentReflectionTest(_ComponentReflectionTest):
1424
@testing.requires.foreign_key_constraint_reflection
1525
def test_get_foreign_keys(self):

0 commit comments

Comments
 (0)