From 962e58dd0074d5fe57ac0fc7f2f55a73abd1b7e7 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Thu, 31 Oct 2024 11:15:00 +0800 Subject: [PATCH] Fix the dtypes_pandas --- pygmt/tests/test_clib_virtualfile_from_vectors.py | 4 +--- pygmt/tests/test_clib_virtualfiles.py | 14 -------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/pygmt/tests/test_clib_virtualfile_from_vectors.py b/pygmt/tests/test_clib_virtualfile_from_vectors.py index e737e87d63d..041bc7a803c 100644 --- a/pygmt/tests/test_clib_virtualfile_from_vectors.py +++ b/pygmt/tests/test_clib_virtualfile_from_vectors.py @@ -27,10 +27,8 @@ def fixture_dtypes_pandas(dtypes): List of supported pandas dtypes. """ dtypes_pandas = dtypes.copy() - if find_spec("pyarrow") is not None: - dtypes_pandas.extend([f"{dtype}[pyarrow]" for dtype in dtypes_pandas]) - + dtypes_pandas.extend([f"{np.dtype(dtype).name}[pyarrow]" for dtype in dtypes]) return tuple(dtypes_pandas) diff --git a/pygmt/tests/test_clib_virtualfiles.py b/pygmt/tests/test_clib_virtualfiles.py index d6f3965065e..a45a662de71 100644 --- a/pygmt/tests/test_clib_virtualfiles.py +++ b/pygmt/tests/test_clib_virtualfiles.py @@ -2,7 +2,6 @@ Test the Session.open_virtualfile method. """ -from importlib.util import find_spec from pathlib import Path import numpy as np @@ -32,19 +31,6 @@ def fixture_dtypes(): return [dtype for dtype in DTYPES_NUMERIC if dtype != np.timedelta64] -@pytest.fixture(scope="module", name="dtypes_pandas") -def fixture_dtypes_pandas(dtypes): - """ - List of supported pandas dtypes. - """ - dtypes_pandas = dtypes.copy() - - if find_spec("pyarrow") is not None: - dtypes_pandas.extend([f"{dtype}[pyarrow]" for dtype in dtypes_pandas]) - - return tuple(dtypes_pandas) - - @pytest.mark.benchmark def test_open_virtualfile(dtypes): """