Skip to content

Commit 4dabee3

Browse files
committed
try using a new custom object instead of object
1 parent b2d8aa3 commit 4dabee3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

xarray/tests/test_dataarray.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6836,6 +6836,9 @@ def test_delete_coords():
68366836

68376837

68386838
def test_deepcopy_obj_array():
6839-
x0 = DataArray(np.array([object()]))
6839+
class Dummy:
6840+
pass
6841+
6842+
x0 = DataArray(np.array([Dummy()]))
68406843
x1 = deepcopy(x0)
68416844
assert x0.values[0] is not x1.values[0]

xarray/tests/test_dataset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6457,6 +6457,9 @@ def test_weakref():
64576457

64586458

64596459
def test_deepcopy_obj_array():
6460-
x0 = Dataset(dict(foo=DataArray(np.array([object()]))))
6460+
class Dummy:
6461+
pass
6462+
6463+
x0 = Dataset(dict(foo=DataArray(np.array([Dummy()]))))
64616464
x1 = deepcopy(x0)
64626465
assert x0["foo"].values[0] is not x1["foo"].values[0]

0 commit comments

Comments
 (0)