Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley committed Feb 27, 2025
1 parent 27d0800 commit 31dd165
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/iris/tests/integration/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
TESTED_PROTOCOLS = list(range(MIN_PICKLE_PROTOCOL, pickle.HIGHEST_PROTOCOL + 1))


def pickle_cube(path, protocol, tmp_path):
def pickle_cube(path, protocol, filename):
# Ensure that data proxies are pickleable.
cube = iris.load(path)[0]
with tmp_path as filename:
with open(filename, "wb") as f:
pickle.dump(cube, f, protocol)
with open(filename, "rb") as f:
ncube = pickle.load(f)
with open(filename, "wb") as f:
pickle.dump(cube, f, protocol)
with open(filename, "rb") as f:
ncube = pickle.load(f)
assert ncube == cube


Expand Down

0 comments on commit 31dd165

Please sign in to comment.