Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save temporary file in test to temporary location #465

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions spyder_kernels/utils/tests/test_iofuncs.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,14 @@ def test_spydata_export(input_namespace, expected_namespace,
pass


def test_save_load_hdf5_files():
def test_save_load_hdf5_files(tmp_path):
"""Simple test to check that we can save and load HDF5 files."""
h5_file = tmp_path / "test.h5"
data = {'a' : [1, 2, 3, 4], 'b' : 4.5}
iofuncs.save_hdf5(data, "test.h5")
iofuncs.save_hdf5(data, h5_file)

expected = ({'a': np.array([1, 2, 3, 4]), 'b': np.array(4.5)}, None)
assert repr(iofuncs.load_hdf5("test.h5")) == repr(expected)
assert repr(iofuncs.load_hdf5(h5_file)) == repr(expected)


def test_load_dicom_files():
Expand Down
Loading