Skip to content
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
42 changes: 0 additions & 42 deletions lib/iris/tests/integration/test_pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
import iris.tests as tests

import pickle
import unittest

import iris

if tests.GRIB_AVAILABLE:
from iris_grib.message import GribMessage


class Common:
def pickle_cube(self, protocol):
Expand All @@ -39,44 +35,6 @@ def test_protocol_2(self):
self.pickle_cube(2)


@tests.skip_data
@tests.skip_grib
class TestGribMessage(Common, tests.IrisTest):
def setUp(self):
self.path = tests.get_data_path(("GRIB", "fp_units", "hours.grib2"))

def pickle_obj(self, obj):
with self.temp_filename(".pkl") as filename:
with open(filename, "wb") as f:
pickle.dump(obj, f)

# These probably "ought" to work, but currently fail.
# see https://github.com/SciTools/iris/pull/2608
@unittest.expectedFailure
def test_protocol_0(self):
super().test_protocol_0()

@unittest.expectedFailure
def test_protocol_1(self):
super().test_protocol_1()

@unittest.expectedFailure
def test_protocol_2(self):
super().test_protocol_2()

def test(self):
# Check that a GribMessage pickles without errors.
messages = GribMessage.messages_from_filename(self.path)
obj = next(messages)
self.pickle_obj(obj)

def test_data(self):
# Check that GribMessage.data pickles without errors.
messages = GribMessage.messages_from_filename(self.path)
obj = next(messages).data
self.pickle_obj(obj)


@tests.skip_data
class test_netcdf(Common, tests.IrisTest):
def setUp(self):
Expand Down