From 5c5dc89438874a53188bab05aa892922178a3af4 Mon Sep 17 00:00:00 2001 From: karosis88 Date: Sat, 30 Sep 2023 11:24:41 +0300 Subject: [PATCH] Add smoke test --- tests/test_smoke.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_smoke.py diff --git a/tests/test_smoke.py b/tests/test_smoke.py new file mode 100644 index 0000000..ebdfa8d --- /dev/null +++ b/tests/test_smoke.py @@ -0,0 +1,16 @@ +import pytest +import anysqlite + +@pytest.mark.anyio +async def test_anysqlite(): + db = await anysqlite.connect(":memory:") + + try: + cursor = await db.cursor() + await cursor.execute("CREATE TABLE anysqlite_test(version TEXT)") + await cursor.execute("INSERT INTO anysqlite_test VALUES(?)", [anysqlite.__version__]) + await cursor.execute("SELECT * FROM anysqlite_test") + + assert (anysqlite.__version__, ) == await cursor.fetchone() + finally: + await db.close() \ No newline at end of file