-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
About
That's a reasonable micro-example bearing a fluent API that may deserve to be presented better. The right slot for a snippet would probably be testing/native/python-pytest.
from cratedb_toolkit.io.sql import DatabaseAdapter
HERE = Path(__file__).parent
@pytest.fixture()
def cratedb() -> DatabaseAdapter:
return DatabaseAdapter(dburi="crate://crate@localhost:4200")
@pytest.fixture(scope="function", autouse=True)
def init_database(cratedb):
"""
Initialize database.
"""
cratedb.run_sql("DROP TABLE IF EXISTS time_series_data;")
cratedb.run_sql((HERE / "init.sql").read_text())
References
Outlook
After slotting it in, based on interests and spirit, such details may also want to be converged into relevant micro-tutorials and/or quick social media posts, à la "Efficient Software Testing with Python and CrateDB".
/cc @simonprickett, @kneth
Metadata
Metadata
Assignees
Labels
No labels