File tree Expand file tree Collapse file tree 2 files changed +1
-40
lines changed
Expand file tree Collapse file tree 2 files changed +1
-40
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ def test_fetching():
4040
4141 result4 = conn .execute (
4242 f"SELECT COUNT(*) FROM batch_data WHERE name LIKE 'name_{ thread_id } _%'"
43- ).fetcharrow_table ()
43+ ).fetch_arrow_table ()
4444 assert result4 .num_rows == 1
4545 finally :
4646 conn .close ()
Original file line number Diff line number Diff line change @@ -84,45 +84,6 @@ def test_dynamic_module_loading():
8484 assert result == 42
8585
8686
87- @pytest .mark .parallel_threads (1 )
88- def test_complete_module_unload_with_live_connections ():
89- """Test the dangerous scenario: complete module unload with live connections."""
90-
91- import duckdb
92-
93- conn1 = duckdb .connect (":memory:" )
94- conn1 .execute ("CREATE TABLE danger_test (id INTEGER)" )
95- conn1 .execute ("INSERT INTO danger_test VALUES (123)" )
96-
97- module_id_1 = id (sys .modules ["duckdb" ])
98-
99- if "duckdb" in sys .modules :
100- del sys .modules ["duckdb" ]
101- del duckdb
102-
103- # TODO: Rethink this behavior - the module is unloaded, but we
104- # didn't invalidate all the connections and state... so even after
105- # unload, conn1 works.
106-
107- result = conn1 .execute ("SELECT * FROM danger_test" ).fetchone ()[0 ]
108- assert result == 123
109-
110- # Reimport creates new module state, but static cache should be reset
111- import duckdb
112-
113- module_id_2 = id (sys .modules ["duckdb" ])
114- assert module_id_1 != module_id_2 , "Should have different module instances"
115-
116- conn2 = duckdb .connect (":memory:" )
117- conn2 .execute ("CREATE TABLE safe_test (id INTEGER)" )
118- conn2 .execute ("INSERT INTO safe_test VALUES (456)" )
119- result2 = conn2 .execute ("SELECT * FROM safe_test" ).fetchone ()[0 ]
120- assert result2 == 456
121-
122- conn2 .close ()
123- conn1 .close ()
124-
125-
12687def test_import_cache_consistency ():
12788 """Test that import cache remains consistent across module operations."""
12889
You can’t perform that action at this time.
0 commit comments