Skip to content

Commit 55df1e8

Browse files
authored
CLN: Split integer array tests (#32910)
1 parent cd52920 commit 55df1e8

10 files changed

+1190
-1125
lines changed

pandas/tests/arrays/integer/__init__.py

Whitespace-only changes.
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import numpy as np
2+
import pytest
3+
4+
from pandas.core.arrays import integer_array
5+
from pandas.core.arrays.integer import (
6+
Int8Dtype,
7+
Int16Dtype,
8+
Int32Dtype,
9+
Int64Dtype,
10+
UInt8Dtype,
11+
UInt16Dtype,
12+
UInt32Dtype,
13+
UInt64Dtype,
14+
)
15+
16+
17+
@pytest.fixture(
18+
params=[
19+
Int8Dtype,
20+
Int16Dtype,
21+
Int32Dtype,
22+
Int64Dtype,
23+
UInt8Dtype,
24+
UInt16Dtype,
25+
UInt32Dtype,
26+
UInt64Dtype,
27+
]
28+
)
29+
def dtype(request):
30+
return request.param()
31+
32+
33+
@pytest.fixture
34+
def data(dtype):
35+
return integer_array(
36+
list(range(8)) + [np.nan] + list(range(10, 98)) + [np.nan] + [99, 100],
37+
dtype=dtype,
38+
)
39+
40+
41+
@pytest.fixture
42+
def data_missing(dtype):
43+
return integer_array([np.nan, 1], dtype=dtype)
44+
45+
46+
@pytest.fixture(params=["data", "data_missing"])
47+
def all_data(request, data, data_missing):
48+
"""Parametrized fixture giving 'data' and 'data_missing'"""
49+
if request.param == "data":
50+
return data
51+
elif request.param == "data_missing":
52+
return data_missing

0 commit comments

Comments
 (0)