Skip to content

Commit

Permalink
try using a contextmanager appveyor/ci#2547
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfast committed Aug 31, 2020
1 parent 646a28b commit 7f75ba1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions holoviews/tests/core/data/testibisinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@


def create_temp_db(df, name, index=False):
file_obj = NamedTemporaryFile(dir=".")
con = sqlite3.Connection(file_obj.name)
with tempfile.NamedTemporaryFile(delete=False) as my_file:
filename = my_file.name
con = sqlite3.Connection(filename)
df.to_sql(name, con, index=index)
return sqlite.connect(file_obj.name)
return sqlite.connect(filename)


class IbisDatasetTest(HeterogeneousColumnTests, ScalarColumnTests, InterfaceTests):
Expand Down

0 comments on commit 7f75ba1

Please sign in to comment.