Skip to content

Commit 984da3a

Browse files
committed
Enable tests for enums and schemas
These features are supported in v20.2+
1 parent 36a8a16 commit 984da3a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cockroachdb/sqlalchemy/dialect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def initialize(self, connection):
117117
# often.
118118
super(PGDialect, self).initialize(connection)
119119
self.implicit_returning = True
120-
self.supports_native_enum = False
121120
self.supports_smallserial = False
122121
self._backslash_escapes = False
123122
sversion = connection.scalar("select version()")
@@ -130,6 +129,7 @@ def initialize(self, connection):
130129
self._has_native_json = self._is_v2plus
131130
self._has_native_jsonb = self._is_v2plus
132131
self._supports_savepoints = self._is_v201plus
132+
self.supports_native_enum = self._is_v202plus
133133

134134
def _get_server_version_info(self, conn):
135135
# PGDialect expects a postgres server version number here,

cockroachdb/sqlalchemy/test_requirements.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ class Requirements(SuiteRequirements):
5353
emulated_lastrowid = exclusions.open()
5454
dbapi_lastrowid = exclusions.open()
5555
views = exclusions.open()
56-
schemas = exclusions.closed()
56+
schemas = exclusions.skip_if(lambda config: not config.db.dialect._is_v202plus,
57+
"versions before 20.2 do not suport schemas")
5758
sequences = exclusions.closed()
5859
sequences_optional = exclusions.closed()
5960
temporary_views = exclusions.closed()

0 commit comments

Comments
 (0)