Skip to content

Commit 3779133

Browse files
committed
fix: add missing closing import
1 parent a43feed commit 3779133

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

tests/create_sequence_data.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import shutil
2-
from contextlib import contextmanager
2+
from contextlib import contextmanager, closing
33
from pathlib import Path
4+
from experanto.interpolators import Interpolator
45

56
import numpy as np
67
import yaml
@@ -106,10 +107,8 @@ def sequence_data_and_interpolator(data_kwargs=None, interp_kwargs=None):
106107
interp_kwargs = interp_kwargs or {}
107108
with create_sequence_data(**data_kwargs) as (timestamps, data, shifts):
108109
# Restore the helper expected by the rest of the test suite
109-
from experanto.interpolators import Interpolator
110110

111-
seq_interp = Interpolator.create(str(SEQUENCE_ROOT), **interp_kwargs)
112-
try:
111+
with closing(
112+
Interpolator.create(str(SEQUENCE_ROOT), **interp_kwargs)
113+
) as seq_interp:
113114
yield timestamps, data, shifts, seq_interp
114-
finally:
115-
seq_interp.close()

0 commit comments

Comments
 (0)