Skip to content

Commit

Permalink
Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Jul 25, 2019
1 parent 3c62481 commit 1acd9f2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions lib/iris/tests/unit/lazy_data/test_as_lazy_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,11 @@ def test_masked(self):
self.assertIsInstance(result, da.core.Array)

def test_non_default_chunks(self):
data = np.arange(30)
chunks = 12
old_limit = iris._lazy_data._MAX_CHUNK_SIZE
iris._lazy_data._MAX_CHUNK_SIZE = 25
data = np.arange(24)
chunks = (12,)
lazy_data = as_lazy_data(data, chunks=chunks)
iris._lazy_data._MAX_CHUNK_SIZE = old_limit
result = lazy_data.chunks[0][0]
self.assertEqual(result, 24)

def test_non_default_chunks__chunks_already_set(self):
chunks = 12
data = da.from_array(np.arange(24), chunks=chunks)
lazy_data = as_lazy_data(data)
result, = np.unique(lazy_data.chunks)
self.assertEqual(result, chunks)
self.assertEqual(result, 24)

def test_with_masked_constant(self):
masked_data = ma.masked_array([8], mask=True)
Expand Down

0 comments on commit 1acd9f2

Please sign in to comment.