diff --git a/xarray/tests/test_dataarray.py b/xarray/tests/test_dataarray.py index 30385779e5f..091eee7ebd8 100644 --- a/xarray/tests/test_dataarray.py +++ b/xarray/tests/test_dataarray.py @@ -3125,7 +3125,9 @@ def test_to_and_from_dict(self): expected_no_data = expected.copy() del expected_no_data['data'] del expected_no_data['coords']['x']['data'] - expected_no_data['coords']['x'].update({'dtype': 'U1' + expected_no_data['coords']['x'].update({'dtype': endiantype, + 'shape': (2,)}) expected_no_data.update({'dtype': 'float64', 'shape': (2, 3)}) actual_no_data = array.to_dict(data=False) assert expected_no_data == actual_no_data diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index c4925352bbc..781b00ec5b1 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -3445,7 +3445,8 @@ def test_to_and_from_dict(self): del expected_no_data['coords']['t']['data'] del expected_no_data['data_vars']['a']['data'] del expected_no_data['data_vars']['b']['data'] - expected_no_data['coords']['t'].update({'dtype': 'U1' + expected_no_data['coords']['t'].update({'dtype': endiantype, 'shape': (10,)}) expected_no_data['data_vars']['a'].update({'dtype': 'float64', 'shape': (10,)}) diff --git a/xarray/tests/test_formatting.py b/xarray/tests/test_formatting.py index 8a3c95a4962..be3e368e02b 100644 --- a/xarray/tests/test_formatting.py +++ b/xarray/tests/test_formatting.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from textwrap import dedent +import sys import numpy as np import pandas as pd @@ -204,6 +205,7 @@ def test_diff_array_repr(self): 'label': ('x', np.array([1, 2], dtype='int64'))}, attrs={'units': 'kg'}) + byteorder = '<' if sys.byteorder == 'little' else '>' expected = dedent("""\ Left and right DataArray objects are not identical Differing dimensions: @@ -215,8 +217,8 @@ def test_diff_array_repr(self): R array([1, 2], dtype=int64) Differing coordinates: - L * x (x) ' expected = dedent("""\ Left and right Dataset objects are not identical Differing dimensions: (x: 2, y: 3) != (x: 2) Differing coordinates: - L * x (x)