Skip to content

Commit 8cfdb5b

Browse files
seismanweiji14
andauthored
clib.conversion._to_numpy: Use pytest.mark.skipif to skip string_view type test for pyarrow < 16 (#3660)
* Use pytest.mark.skipif to skip string_view type test for pyarrow < 16 * Use pyarrow.__version__ --------- Co-authored-by: Wei Ji <[email protected]>
1 parent dff8e77 commit 8cfdb5b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pygmt/tests/test_clib_to_numpy.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class pa: # noqa: N801
2424
A dummy class to mimic pyarrow.
2525
"""
2626

27+
__version__ = "0.0.0"
28+
2729
@staticmethod
2830
def timestamp(unit: str, tz: str | None = None):
2931
"""
@@ -336,7 +338,13 @@ def test_to_numpy_pyarrow_numeric_with_na(dtype, expected_dtype):
336338
"utf8", # alias for string
337339
"large_string",
338340
"large_utf8", # alias for large_string
339-
"string_view",
341+
pytest.param(
342+
"string_view",
343+
marks=pytest.mark.skipif(
344+
Version(pa.__version__) < Version("16"),
345+
reason="string_view type was added since pyarrow 16",
346+
),
347+
),
340348
],
341349
)
342350
def test_to_numpy_pyarrow_string(dtype):

0 commit comments

Comments
 (0)