From c769028633c793f6391ac1548e52376e72870928 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 27 Jul 2022 17:56:08 +0800 Subject: [PATCH] Fix the test failure --- pygmt/tests/test_accessor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pygmt/tests/test_accessor.py b/pygmt/tests/test_accessor.py index b406e18c4a0..f77842b5c4f 100644 --- a/pygmt/tests/test_accessor.py +++ b/pygmt/tests/test_accessor.py @@ -130,6 +130,10 @@ def test_accessor_grid_source_file_not_found(): # manually set the registration and gtype dataset.height.gmt.registration = 1 dataset.height.gmt.gtype = 1 - # the registration and gtype should be correct now. - assert dataset.height.gmt.registration == 1 - assert dataset.height.gmt.gtype == 1 + # the registration and gtype still have default values. + # Quote from https://docs.xarray.dev/en/stable/internals/extending-xarray.html + # > New instances, like those created from arithmetic operations or when + # > accessing a DataArray from a Dataset (ex. ds[var_name]), will have + # > new accessors created. + assert dataset.height.gmt.registration == 0 + assert dataset.height.gmt.gtype == 0