mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
--managed-python, fix flakey tests
This commit is contained in:
parent
8bc206fa0b
commit
681f9028af
2 changed files with 4 additions and 2 deletions
4
Makefile
4
Makefile
|
|
@ -181,10 +181,10 @@ publish-release:
|
||||||
|
|
||||||
# -k test_vec0_update
|
# -k test_vec0_update
|
||||||
test-loadable: loadable
|
test-loadable: loadable
|
||||||
uv run --project tests pytest -vv -s -x . tests/test-*.py
|
uv run --managed-python --project tests pytest -vv -s -x . tests/test-*.py
|
||||||
|
|
||||||
test-loadable-snapshot-update: loadable
|
test-loadable-snapshot-update: loadable
|
||||||
uv run --project tests pytest -vv tests/test-loadable.py --snapshot-update
|
uv run --managed-python --project tests pytest -vv tests/test-loadable.py --snapshot-update
|
||||||
|
|
||||||
test-loadable-watch:
|
test-loadable-watch:
|
||||||
watchexec --exts c,py,Makefile --clear -- make test-loadable
|
watchexec --exts c,py,Makefile --clear -- make test-loadable
|
||||||
|
|
|
||||||
|
|
@ -2328,6 +2328,7 @@ def test_vec0_stress_small_chunks():
|
||||||
data = np.zeros((1000, 8), dtype=np.float32)
|
data = np.zeros((1000, 8), dtype=np.float32)
|
||||||
for i in range(1000):
|
for i in range(1000):
|
||||||
data[i] = np.array([(i + 1) * 0.1] * 8)
|
data[i] = np.array([(i + 1) * 0.1] * 8)
|
||||||
|
db.execute("drop table if exists vec_small")
|
||||||
db.execute("create virtual table vec_small using vec0(chunk_size=8, a float[8])")
|
db.execute("create virtual table vec_small using vec0(chunk_size=8, a float[8])")
|
||||||
assert execute_all(db, "select rowid, * from vec_small") == []
|
assert execute_all(db, "select rowid, * from vec_small") == []
|
||||||
with db:
|
with db:
|
||||||
|
|
@ -2512,6 +2513,7 @@ def topk(
|
||||||
def test_stress1():
|
def test_stress1():
|
||||||
np.random.seed(1234)
|
np.random.seed(1234)
|
||||||
data = np.random.uniform(-1.0, 1.0, (8000, 128)).astype(np.float32)
|
data = np.random.uniform(-1.0, 1.0, (8000, 128)).astype(np.float32)
|
||||||
|
db.execute("drop table if exists vec_stress1")
|
||||||
db.execute(
|
db.execute(
|
||||||
"create virtual table vec_stress1 using vec0( a float[128] distance_metric=cosine)"
|
"create virtual table vec_stress1 using vec0( a float[128] distance_metric=cosine)"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue