DuckDB spawns non-daemon background threads on import. Since analytics.py was imported at module level (transitively by the test suite), these threads kept the pytest process alive after all tests completed. Moving the import into open_analytics_db() means duckdb is only loaded when actually needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>