Repository navigation
Commit 5af30d5
fix: close leaked InMemoryCatalog connection in test_load_catalog_in_memory
Fixes unclosed sqlite3.Connection ResourceWarning that surfaces during
test setup in Python 3.14 CI runs. The test was creating an InMemoryCatalog
via load_catalog() without explicitly closing it, violating the explicit
cleanup pattern established for issue apache#2530.
The warning surfaces later (during setup of the next test in execution order)
due to Python's deferred garbage collection of the unreferenced catalog object,
causing pytest to attribute it to an unrelated test module. Root cause confirmed
by investigation: this test was the only unclosed catalog instance remaining
in the tests/ suite.
Changes:
- Bind the returned catalog to a variable and close it explicitly via try/finally,
mirroring the pattern already established in test_bigquery_metastore.py
All tests/catalog/ tests now pass with strict ResourceWarning enforcement.
Co-Authored-By: Claude Haiku 4.5 <[email protected]>1 parent 08f6fb4 commit 5af30d5
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
| |||
0 commit comments