Skip to content

Commit

Permalink
fix the correct test
Browse files Browse the repository at this point in the history
  • Loading branch information
shoyer committed Jun 27, 2019
1 parent 0974340 commit 133befd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xarray/tests/test_backends.py
Expand Up @@ -775,9 +775,7 @@ def test_encoding_kwarg(self):
ds = Dataset({'x': ('y', np.arange(10.0))})
kwargs = dict(encoding={'x': {'dtype': 'f4'}})
with self.roundtrip(ds, save_kwargs=kwargs) as actual:
encoded_dtype = actual.x.encoding['dtype']
# On OS X, dtype sometimes switches endianness for unclear reasons
assert str(encoded_dtype)[-2:] == 'f4'
assert actual.x.encoding['dtype'] == 'f4'
assert ds.x.encoding == {}

kwargs = dict(encoding={'x': {'foo': 'bar'}})
Expand Down Expand Up @@ -869,7 +867,9 @@ def test_encoding_same_dtype(self):
ds = Dataset({'x': ('y', np.arange(10.0, dtype='f4'))})
kwargs = dict(encoding={'x': {'dtype': 'f4'}})
with self.roundtrip(ds, save_kwargs=kwargs) as actual:
assert actual.x.encoding['dtype'] == 'f4'
encoded_dtype = actual.x.encoding['dtype']
# On OS X, dtype sometimes switches endianness for unclear reasons
assert encoded_dtype.kind == 'f' and encoded_dtype.itemsize == 4
assert ds.x.encoding == {}

def test_append_write(self):
Expand Down

0 comments on commit 133befd

Please sign in to comment.