Skip to content

Commit

Permalink
Fix the test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jul 27, 2022
1 parent 37869d4 commit 7b0520a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pygmt/tests/test_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Test the behaviour of the GMTDataArrayAccessor class.
"""
import os
from calendar import day_abbr
from pathlib import Path

import pytest
Expand Down Expand Up @@ -130,6 +129,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

0 comments on commit 7b0520a

Please sign in to comment.