Skip to content

Commit 3deb686

Browse files
committed
fixup! Tests: Improve resource teardown by closing/disposing connections etc.
1 parent 0fc85de commit 3deb686

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

ingestr/main_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,8 +4261,6 @@ def test_stripe_source_full_refresh(stripe_table):
42614261
rel_db_path_to_command = f"ingestr/testdata/{dbname}"
42624262
uri = f"duckdb:///{rel_db_path_to_command}"
42634263

4264-
conn = duckdb.connect(abs_db_path)
4265-
42664264
# Run ingest command
42674265
result = invoke_ingest_command(
42684266
f"stripe://{stripe_table}s?api_key={stripe_token}",
@@ -4274,6 +4272,7 @@ def test_stripe_source_full_refresh(stripe_table):
42744272
assert result.exit_code == 0
42754273

42764274
# Verify data was loaded
4275+
conn = duckdb.connect(abs_db_path)
42774276
res = conn.sql(f"select count(*) from raw.{stripe_table}s").fetchone()
42784277
assert res[0] > 0, f"No {stripe_table} records found"
42794278

@@ -4300,8 +4299,6 @@ def test_stripe_source_incremental(stripe_table):
43004299
rel_db_path_to_command = f"ingestr/testdata/{dbname}"
43014300
uri = f"duckdb:///{rel_db_path_to_command}"
43024301

4303-
conn = duckdb.connect(abs_db_path)
4304-
43054302
# Run ingest command
43064303
result = invoke_ingest_command(
43074304
f"stripe://{stripe_table}s?api_key={stripe_token}",
@@ -4315,6 +4312,7 @@ def test_stripe_source_incremental(stripe_table):
43154312
assert result.exit_code == 0
43164313

43174314
# Verify data was loaded
4315+
conn = duckdb.connect(abs_db_path)
43184316
res = conn.sql(f"select count(*) from raw.{stripe_table}s").fetchone()
43194317
assert res[0] > 0, f"No {stripe_table} records found"
43204318

0 commit comments

Comments
 (0)