Skip to content

Commit a09fb02

Browse files
authored
Get iris-grib tests passing with the latest version of eccodes (#189)
1 parent 1f859fc commit a09fb02

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ channels:
22
- conda-forge
33
dependencies:
44
- iris>=2
5-
- python-eccodes>=0.9.1,<2
5+
- python-eccodes
66
- pep8

iris_grib/tests/unit/test_save_messages.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import iris_grib.tests as tests
1111

1212
import gribapi
13-
import numpy as np
1413
from unittest import mock
1514

1615
import iris_grib
@@ -24,22 +23,14 @@ def setUp(self):
2423
def test_save(self):
2524
m = mock.mock_open()
2625
with mock.patch('builtins.open', m, create=True):
27-
# sending a MagicMock object to gribapi raises an AssertionError
28-
# as the gribapi code does a type check
29-
# this is deemed acceptable within the scope of this unit test
30-
with self.assertRaises((AssertionError, TypeError)):
31-
iris_grib.save_messages([self.grib_message], 'foo.grib2')
26+
iris_grib.save_messages([self.grib_message], 'foo.grib2')
3227
self.assertTrue(mock.call('foo.grib2', 'wb') in m.mock_calls)
3328

3429
def test_save_append(self):
3530
m = mock.mock_open()
3631
with mock.patch('builtins.open', m, create=True):
37-
# sending a MagicMock object to gribapi raises an AssertionError
38-
# as the gribapi code does a type check
39-
# this is deemed acceptable within the scope of this unit test
40-
with self.assertRaises((AssertionError, TypeError)):
41-
iris_grib.save_messages([self.grib_message], 'foo.grib2',
42-
append=True)
32+
iris_grib.save_messages([self.grib_message], 'foo.grib2',
33+
append=True)
4334
self.assertTrue(mock.call('foo.grib2', 'ab') in m.mock_calls)
4435

4536

0 commit comments

Comments
 (0)