forked from cleveragents/cleveragents-core
29620c4ba8
The _resolve_sqlite_url function and _ensure_sqlite_parent_dir helper incorrectly treated special SQLite connection strings (e.g. :memory:) as relative file paths, resolving them to absolute filesystem paths like sqlite:////app/:memory:. This broke all tests using in-memory databases via Settings(database_url='sqlite:///:memory:'). Changes: - Guard _resolve_sqlite_url against paths starting with ':' (special SQLite URLs like :memory:) - Guard _ensure_sqlite_parent_dir against the same pattern - Wrap mkdir in _ensure_sqlite_parent_dir with try/except OSError so invalid absolute paths (e.g. /nonexistent_root/...) fail gracefully instead of crashing before the engine has a chance to raise - Update test for invalid session factory URL to use an absolute path that cannot be created, rather than a relative path that _ensure_sqlite_parent_dir would now successfully create