Add schema_version on python side, with match test

This commit is contained in:
Jacob Hinkle 2022-09-18 19:43:05 -04:00
parent cbb8180ff3
commit 10f5fac0e7
2 changed files with 11 additions and 0 deletions

View File

@ -3,6 +3,9 @@ import os
import sqlite3
schema_version = 2
def init(path):
"""
Initialize a data store directory.

8
tests/test_db.py Normal file
View File

@ -0,0 +1,8 @@
def test_schema_version_match():
import nancy
from nancy.version import schema_version
cur = nancy._conn.cursor()
(db_schema_ver,) = cur.execute("PRAGMA user_version;").fetchone()
assert schema_version == db_schema_ver