Skip to content

Commit 7b0520a

Browse files
committed
Fix the test failure
1 parent 37869d4 commit 7b0520a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pygmt/tests/test_accessor.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Test the behaviour of the GMTDataArrayAccessor class.
33
"""
44
import os
5-
from calendar import day_abbr
65
from pathlib import Path
76

87
import pytest
@@ -130,6 +129,10 @@ def test_accessor_grid_source_file_not_found():
130129
# manually set the registration and gtype
131130
dataset.height.gmt.registration = 1
132131
dataset.height.gmt.gtype = 1
133-
# the registration and gtype should be correct now.
134-
assert dataset.height.gmt.registration == 1
135-
assert dataset.height.gmt.gtype == 1
132+
# the registration and gtype still have default values.
133+
# Quote from https://docs.xarray.dev/en/stable/internals/extending-xarray.html
134+
# > New instances, like those created from arithmetic operations or when
135+
# > accessing a DataArray from a Dataset (ex. ds[var_name]), will have
136+
# > new accessors created.
137+
assert dataset.height.gmt.registration == 0
138+
assert dataset.height.gmt.gtype == 0

0 commit comments

Comments
 (0)