Skip to content

Commit 4fe47da

Browse files
committed
fix: test fixture creation
1 parent 43bd853 commit 4fe47da

File tree

2 files changed

+59
-47
lines changed

2 files changed

+59
-47
lines changed

xarray/tests/test_dataarray.py

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,14 +1874,16 @@ def test_reindex_empty_array_dtype(self) -> None:
18741874
[
18751875
pytest.param(pd.Categorical(["a", "b", "c"]), id="categorical"),
18761876
]
1877-
+ [
1878-
pytest.param(
1879-
pd.array([1, 2, 3], dtype="int64[pyarrow]"),
1880-
id="int64[pyarrow]",
1881-
)
1882-
]
1883-
if has_pyarrow
1884-
else [],
1877+
+ (
1878+
[
1879+
pytest.param(
1880+
pd.array([1, 2, 3], dtype="int64[pyarrow]"),
1881+
id="int64[pyarrow]",
1882+
)
1883+
]
1884+
if has_pyarrow
1885+
else []
1886+
),
18851887
)
18861888
def test_reindex_extension_array(self, extension_array) -> None:
18871889
srs = pd.Series(index=["e", "f", "g"], data=extension_array)
@@ -1902,15 +1904,17 @@ def test_reindex_extension_array(self, extension_array) -> None:
19021904
[
19031905
pytest.param("a", pd.Categorical([pd.NA, "a", "b"]), id="categorical"),
19041906
]
1905-
+ [
1906-
pytest.param(
1907-
0,
1908-
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"),
1909-
id="int64[pyarrow]",
1910-
)
1911-
]
1912-
if has_pyarrow
1913-
else [],
1907+
+ (
1908+
[
1909+
pytest.param(
1910+
0,
1911+
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"),
1912+
id="int64[pyarrow]",
1913+
)
1914+
]
1915+
if has_pyarrow
1916+
else []
1917+
),
19141918
)
19151919
def test_fillna_extension_array(self, fill_value, extension_array) -> None:
19161920
srs: pd.Series = pd.Series(index=np.array([1, 2, 3]), data=extension_array)
@@ -1934,13 +1938,15 @@ def test_fillna_extension_array_bad_val(self) -> None:
19341938
[
19351939
pytest.param(pd.Categorical([pd.NA, "a", "b"]), id="categorical"),
19361940
]
1937-
+ [
1938-
pytest.param(
1939-
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"), id="int64[pyarrow]"
1940-
)
1941-
]
1942-
if has_pyarrow
1943-
else [],
1941+
+ (
1942+
[
1943+
pytest.param(
1944+
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"), id="int64[pyarrow]"
1945+
)
1946+
]
1947+
if has_pyarrow
1948+
else []
1949+
),
19441950
)
19451951
def test_dropna_extension_array(self, extension_array) -> None:
19461952
srs: pd.Series = pd.Series(index=np.array([1, 2, 3]), data=extension_array)

xarray/tests/test_dataset.py

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,13 +1921,15 @@ def test_categorical_index_reindex(self) -> None:
19211921
id="categorical",
19221922
),
19231923
]
1924-
+ [
1925-
pytest.param(
1926-
pd.array([1, 1, None], dtype="int64[pyarrow]"), id="int64[pyarrow]"
1927-
)
1928-
]
1929-
if has_pyarrow
1930-
else [],
1924+
+ (
1925+
[
1926+
pytest.param(
1927+
pd.array([1, 1, None], dtype="int64[pyarrow]"), id="int64[pyarrow]"
1928+
)
1929+
]
1930+
if has_pyarrow
1931+
else []
1932+
),
19311933
)
19321934
def test_extensionarray_negative_reindex(self, fill_value, extension_array) -> None:
19331935
ds = xr.Dataset(
@@ -5671,15 +5673,17 @@ def test_dropna(self) -> None:
56715673
[
56725674
pytest.param("a", pd.Categorical([pd.NA, "a", "b"]), id="category"),
56735675
]
5674-
+ [
5675-
pytest.param(
5676-
0,
5677-
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"),
5678-
id="int64[pyarrow]",
5679-
)
5680-
]
5681-
if has_pyarrow
5682-
else [],
5676+
+ (
5677+
[
5678+
pytest.param(
5679+
0,
5680+
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"),
5681+
id="int64[pyarrow]",
5682+
)
5683+
]
5684+
if has_pyarrow
5685+
else []
5686+
),
56835687
)
56845688
def test_fillna_extension_array(self, fill_value, extension_array) -> None:
56855689
srs = pd.DataFrame({"data": extension_array}, index=np.array([1, 2, 3]))
@@ -5696,13 +5700,15 @@ def test_fillna_extension_array(self, fill_value, extension_array) -> None:
56965700
[
56975701
pytest.param(pd.Categorical([pd.NA, "a", "b"]), id="category"),
56985702
]
5699-
+ [
5700-
pytest.param(
5701-
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"), id="int64[pyarrow]"
5702-
)
5703-
]
5704-
if has_pyarrow
5705-
else [],
5703+
+ (
5704+
[
5705+
pytest.param(
5706+
pd.array([pd.NA, 1, 1], dtype="int64[pyarrow]"), id="int64[pyarrow]"
5707+
)
5708+
]
5709+
if has_pyarrow
5710+
else []
5711+
),
57065712
)
57075713
def test_dropna_extension_array(self, extension_array) -> None:
57085714
srs = pd.DataFrame({"data": extension_array}, index=np.array([1, 2, 3]))

0 commit comments

Comments
 (0)