Skip to content

Commit c338620

Browse files
committed
Reduce extensionarray data length from 100 to 10
1 parent 08d21d7 commit c338620

25 files changed

+74
-89
lines changed

pandas/tests/arrays/boolean/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def data():
1212
"""Fixture returning boolean array with valid and missing values."""
1313
return pd.array(
14-
[True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False],
14+
[True, False] + [np.nan] + [True, False] * 2 + [np.nan] + [True, False],
1515
dtype="boolean",
1616
)
1717

pandas/tests/arrays/boolean/test_comparison.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
def data():
1212
"""Fixture returning boolean array with valid and missing data"""
1313
return pd.array(
14-
[True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False],
14+
[True, False] + [np.nan] + [True, False] * 2 + [np.nan] + [True, False],
1515
dtype="boolean",
1616
)
1717

pandas/tests/arrays/boolean/test_reduction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def data():
99
"""Fixture returning boolean array, with valid and missing values."""
1010
return pd.array(
11-
[True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False],
11+
[True, False] + [np.nan] + [True, False] * 2 + [np.nan] + [True, False],
1212
dtype="boolean",
1313
)
1414

pandas/tests/arrays/floating/conftest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import numpy as np
21
import pytest
32

43
import pandas as pd
@@ -18,11 +17,7 @@ def dtype(request):
1817
def data(dtype):
1918
"""Fixture returning 'data' array according to parametrized float 'dtype'"""
2019
return pd.array(
21-
list(np.arange(0.1, 0.9, 0.1))
22-
+ [pd.NA]
23-
+ list(np.arange(1, 9.8, 0.1))
24-
+ [pd.NA]
25-
+ [9.9, 10.0],
20+
[0.1, 0.2] + [pd.NA] + [1.0, 1.1, 1.2, 1.3] + [pd.NA] + [9.9, 10.0],
2621
dtype=dtype,
2722
)
2823

pandas/tests/arrays/integer/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def data(dtype):
3939
Used to test dtype conversion with and without missing values.
4040
"""
4141
return pd.array(
42-
list(range(8)) + [pd.NA] + list(range(10, 98)) + [pd.NA] + [99, 100],
42+
[0, 1] + [pd.NA] + [10, 11, 12, 13] + [pd.NA] + [99, 100],
4343
dtype=dtype,
4444
)
4545

pandas/tests/extension/base/getitem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def test_take_series(self, data):
408408
result = s.take([0, -1])
409409
expected = pd.Series(
410410
data._from_sequence([data[0], data[len(data) - 1]], dtype=s.dtype),
411-
index=range(0, 198, 99),
411+
index=s.index.take([0, -1]),
412412
)
413413
tm.assert_series_equal(result, expected)
414414

pandas/tests/extension/base/interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ class BaseInterfaceTests:
1919
# ------------------------------------------------------------------------
2020

2121
def test_len(self, data):
22-
assert len(data) == 100
22+
assert len(data) == 10
2323

2424
def test_size(self, data):
25-
assert data.size == 100
25+
assert data.size == 10
2626

2727
def test_ndim(self, data):
2828
assert data.ndim == 1

pandas/tests/extension/base/methods.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def test_value_counts_default_dropna(self, data):
3939

4040
@pytest.mark.parametrize("dropna", [True, False])
4141
def test_value_counts(self, all_data, dropna):
42-
all_data = all_data[:10]
4342
if dropna:
4443
other = all_data[~all_data.isna()]
4544
else:
@@ -52,7 +51,7 @@ def test_value_counts(self, all_data, dropna):
5251

5352
def test_value_counts_with_normalize(self, data):
5453
# GH 33172
55-
data = data[:10].unique()
54+
data = data.unique()
5655
values = np.array(data[~data.isna()])
5756
ser = pd.Series(data, dtype=data.dtype)
5857

pandas/tests/extension/base/ops.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ class BaseUnaryOpsTests(BaseOpsUtil):
250250
def test_invert(self, data):
251251
ser = pd.Series(data, name="name")
252252
try:
253-
# 10 is an arbitrary choice here, just avoid iterating over
254-
# the whole array to trim test runtime
255-
[~x for x in data[:10]]
253+
[~x for x in data]
256254
except TypeError:
257255
# scalars don't support invert -> we don't expect the vectorized
258256
# operation to succeed

pandas/tests/extension/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def dtype():
1414
@pytest.fixture
1515
def data():
1616
"""
17-
Length-100 array for this type.
17+
Length-10 array for this type.
1818
1919
* data[0] and data[1] should both be non missing
2020
* data[0] and data[1] should not be equal
@@ -25,7 +25,7 @@ def data():
2525
@pytest.fixture
2626
def data_for_twos(dtype):
2727
"""
28-
Length-100 array in which all the elements are two.
28+
Length-10 array in which all the elements are two.
2929
3030
Call pytest.skip in your fixture if the dtype does not support divmod.
3131
"""

0 commit comments

Comments
 (0)