@@ -1104,26 +1104,29 @@ def test_update_dtype_errors(self, bad_dtype):
11041104 with pytest .raises (ValueError , match = msg ):
11051105 dtype .update_dtype (bad_dtype )
11061106
1107+ import pytest
1108+
11071109class TestArrowDtype (Base ):
11081110 @pytest .fixture
11091111 def dtype (self ):
11101112 """Fixture for ArrowDtype."""
1111- import pyarrow as pa
1113+ pa = pytest . importorskip ( "pyarrow" )
11121114 return ArrowDtype (pa .timestamp ("ns" , tz = "UTC" ))
11131115
11141116 def test_numpy_dtype_preserves_timezone (self , dtype ):
1117+ pa = pytest .importorskip ("pyarrow" )
11151118 # Test timezone-aware timestamp
11161119 assert dtype .numpy_dtype == dtype .pyarrow_dtype .to_pandas_dtype ()
11171120
11181121 def test_numpy_dtype_naive_timestamp (self ):
1119- import pyarrow as pa
1122+ pa = pytest . importorskip ( "pyarrow" )
11201123 arrow_type = pa .timestamp ("ns" )
11211124 dtype = ArrowDtype (arrow_type )
11221125 assert dtype .numpy_dtype == pa .timestamp ("ns" ).to_pandas_dtype ()
11231126
11241127 @pytest .mark .parametrize ("tz" , ["UTC" , "America/New_York" , None ])
11251128 def test_numpy_dtype_with_varied_timezones (self , tz ):
1126- import pyarrow as pa
1129+ pa = pytest . importorskip ( "pyarrow" )
11271130 arrow_type = pa .timestamp ("ns" , tz = tz )
11281131 dtype = ArrowDtype (arrow_type )
11291132 if tz :
0 commit comments