From fbc90fc9618c7fd699647f36820fa552371fcb64 Mon Sep 17 00:00:00 2001 From: Matthew Evans <7916000+ml-evs@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:13:40 +0100 Subject: [PATCH] Update tests/test_Arbin.py Co-authored-by: Chris Kerr --- tests/test_Arbin.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/test_Arbin.py b/tests/test_Arbin.py index 3b5d0d4..dca9eaa 100644 --- a/tests/test_Arbin.py +++ b/tests/test_Arbin.py @@ -58,14 +58,9 @@ def test_convert_Arbin_to_sqlite_function_in_memory(testdata_dir, tmpdir, basena """Convert an Arbin file to an in-memory SQLite database.""" res_file = os.path.join(testdata_dir, basename + ".res") conn = None - try: - conn = res2sqlite.convert_arbin_to_sqlite(res_file) - assert conn is not None + with res2sqlite.convert_arbin_to_sqlite(res_file) as conn: csr = conn.execute("SELECT * FROM Channel_Normal_Table;") csr.fetchone() - finally: - if conn is not None: - conn.close() @pytest.mark.skipif(