crate / sqlalchemy-cratedb

SQLAlchemy dialect for CrateDB.
https://cratedb.com/docs/sqlalchemy-cratedb/
Apache License 2.0
3 stars 2 forks source link

SQLAlchemy: Add Python-based test module for integration tests #88

Closed amotl closed 3 months ago

amotl commented 1 year ago

At https://github.com/crate/crate-python/pull/464#discussion_r1044549726, we observed that

We currently have no place where Python-based SQLAlchemy integration tests are conducted. Currently, there are only Python-based unit tests exercising the CrateDB dialect using corresponding mocks to work around needing a real database. On the other hand, there are integration test cases with SQLAlchemy and CrateDB, but they are only written as doctests.

In order to conduct special test scenarios which don't fit having them written as a doctest, and for improved capabilities to run specific test cases selectively, it may make sense to add a module which fills the gap on running Python-based SQLAlchemy integration test cases against a real database.

amotl commented 1 year ago

At https://github.com/crate/crate-python/pull/490#pullrequestreview-1226990068 ff., we discovered that it would be indeed good to have a spot to run Python-based SQLAlchemy integration tests.

I will stage a corresponding PR where some of @hammerhead's fixes can then be picked into.

Specifically, this is 1429658e. Thank you again!

amotl commented 3 months ago

Integration tests can be written in Python now. Example:

https://github.com/crate/sqlalchemy-cratedb/blob/da977d9a294714feb2ee66144088dce922352604/tests/vector_test.py#L218-L249