Skip to content

Commit de06586

Browse files
committed
added pytest.importorskip("pyarrow")
1 parent 9a60093 commit de06586

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/dtypes/test_factory.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def test_datetime_with_tz():
7171

7272

7373
def test_datetime_pyarrow():
74+
pytest.importorskip("pyarrow")
7475
result = datetime(backend="pyarrow")
7576
assert isinstance(result, ArrowDtype)
7677
assert str(result) == "timestamp[ns][pyarrow]"
@@ -101,6 +102,7 @@ def test_integer_numpy():
101102

102103

103104
def test_integer_pyarrow():
105+
pytest.importorskip("pyarrow")
104106
result = integer(bits=64, backend="pyarrow")
105107
assert isinstance(result, ArrowDtype)
106108
assert str(result) == "int64[pyarrow]"
@@ -126,19 +128,22 @@ def test_floating_numpy():
126128

127129

128130
def test_floating_pyarrow():
131+
pytest.importorskip("pyarrow")
129132
result = floating(bits=64, backend="pyarrow")
130133
assert isinstance(result, ArrowDtype)
131134
assert str(result) == "double[pyarrow]"
132135

133136

134137
# Decimal
135138
def test_decimal_default():
139+
pytest.importorskip("pyarrow")
136140
result = decimal(precision=38, scale=10)
137141
assert isinstance(result, ArrowDtype)
138142
assert str(result) == "decimal128(38, 10)[pyarrow]"
139143

140144

141145
def test_decimal_with_precision_scale():
146+
pytest.importorskip("pyarrow")
142147
result = decimal(precision=10, scale=2)
143148
assert isinstance(result, ArrowDtype)
144149
assert str(result) == "decimal128(10, 2)[pyarrow]"
@@ -152,6 +157,7 @@ def test_boolean_default():
152157

153158

154159
def test_boolean_pyarrow():
160+
pytest.importorskip("pyarrow")
155161
result = boolean(backend="pyarrow")
156162
assert isinstance(result, ArrowDtype)
157163
assert str(result) == "bool[pyarrow]"
@@ -186,6 +192,7 @@ def test_categorical_default():
186192

187193

188194
def test_categorical_pyarrow():
195+
pytest.importorskip("pyarrow")
189196
result = categorical(backend="pyarrow")
190197
assert isinstance(result, ArrowDtype)
191198
assert str(result) == "dictionary<values=string, indices=int32, ordered=0>[pyarrow]"
@@ -199,6 +206,7 @@ def test_interval_default():
199206

200207

201208
def test_interval_pyarrow():
209+
pytest.importorskip("pyarrow")
202210
result = interval(backend="pyarrow")
203211
assert isinstance(result, ArrowDtype)
204212
assert str(result) == "struct<left: double, right: double>[pyarrow]"
@@ -212,32 +220,37 @@ def test_period_default():
212220

213221

214222
def test_period_pyarrow():
223+
pytest.importorskip("pyarrow")
215224
result = period(backend="pyarrow")
216225
assert isinstance(result, ArrowDtype)
217226
assert str(result) == "month_day_nano_interval[pyarrow]"
218227

219228

220229
# Date
221230
def test_date_default():
231+
pytest.importorskip("pyarrow")
222232
result = date()
223233
assert isinstance(result, ArrowDtype)
224234
assert str(result) == "date32[day][pyarrow]"
225235

226236

227237
def test_date_pyarrow():
238+
pytest.importorskip("pyarrow")
228239
result = date(backend="pyarrow")
229240
assert isinstance(result, ArrowDtype)
230241
assert str(result) == "date32[day][pyarrow]"
231242

232243

233244
# Duration
234245
def test_duration_default():
246+
pytest.importorskip("pyarrow")
235247
result = duration()
236248
assert isinstance(result, ArrowDtype)
237249
assert str(result) == "duration[ns][pyarrow]"
238250

239251

240252
def test_duration_pyarrow():
253+
pytest.importorskip("pyarrow")
241254
result = duration(backend="pyarrow")
242255
assert isinstance(result, ArrowDtype)
243256
assert str(result) == "duration[ns][pyarrow]"

0 commit comments

Comments
 (0)