Test just the SQLite portion of the benchmark.
()
| 9 | from benchmark_array_binary import ArrayBenchmarkRunner |
| 10 | |
| 11 | def 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 | |
| 41 | def test_array_generation(): |
| 42 | """Test array data generation.""" |
no test coverage detected