MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_sqlite_only

Function test_sqlite_only

benchmarks/test_array_benchmark_simple.py:11–39  ·  view source on GitHub ↗

Test just the SQLite portion of the benchmark.

()

Source from the content-addressed store, hash-verified

9from benchmark_array_binary import ArrayBenchmarkRunner
10
11def test_sqlite_only():
12 """Test just the SQLite portion of the benchmark."""
13 print("🧪 Testing SQLite array benchmark functionality...")
14
15 runner = ArrayBenchmarkRunner(iterations=3, port=15505)
16
17 # Create temporary database
18 temp_db = tempfile.mktemp(suffix=".db")
19 runner.sqlite_file = temp_db
20
21 try:
22 # Test SQLite benchmark
23 sqlite_times = runner.benchmark_sqlite_arrays(array_size=5)
24
25 print("✅ SQLite benchmark results:")
26 for operation, time_ms in sqlite_times.items():
27 print(f" {operation}: {time_ms*1000:.3f}ms")
28
29 print(f"\n✅ SQLite benchmark test passed!")
30 return True
31
32 except Exception as e:
33 print(f"❌ SQLite benchmark test failed: {e}")
34 return False
35
36 finally:
37 # Cleanup
38 if os.path.exists(temp_db):
39 os.remove(temp_db)
40
41def test_array_generation():
42 """Test array data generation."""

Callers 1

mainFunction · 0.85

Calls 3

removeMethod · 0.45

Tested by

no test coverage detected