Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions test/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from sqlalchemy import MetaData
from sqlalchemy.schema import DDL
from sqlalchemy.testing import config
from sqlalchemy.testing import engines
from sqlalchemy.testing import db
from sqlalchemy.testing import eq_
from sqlalchemy.testing import fixtures
Expand Down Expand Up @@ -811,14 +812,36 @@ def test_empty_insert(self):
def test_insert_from_select_autoinc(self):
pass

@pytest.mark.skip("Spanner doesn't support auto increment")
def test_insert_from_select_autoinc_no_rows(self):
pass

@pytest.mark.skip("Spanner doesn't support default column values")
def test_insert_from_select_with_defaults(self):
pass

def test_autoclose_on_insert(self):
"""
SPANNER OVERRIDE:

Cloud Spanner doesn't support tables with an auto increment primary key,
following insertions will fail with `400 id must not be NULL in table
autoinc_pk`.

Overriding the tests and adding a manual primary key value to avoid the same
failures.
"""
if config.requirements.returning.enabled:
engine = engines.testing_engine(options={"implicit_returning": False})
else:
engine = config.db

with engine.begin() as conn:
r = conn.execute(
self.tables.autoinc_pk.insert(), dict(id=1, data="some data")
)

assert r._soft_closed
assert not r.closed
assert r.is_insert
assert not r.returns_rows


@pytest.mark.skip("Spanner doesn't support IS DISTINCT FROM clause")
class IsOrIsNotDistinctFromTest(_IsOrIsNotDistinctFromTest):
Expand Down