Skip to content

Commit 7e27bf4

Browse files
committed
make positive integers explicit
1 parent 04ad414 commit 7e27bf4

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

pandas/tests/indexes/conftest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ def listlike_box(request):
4545
@pytest.fixture(
4646
params=[
4747
*tm.ALL_REAL_NUMPY_DTYPES,
48-
"datetime64[ns]",
49-
"category",
5048
"object",
49+
"category",
50+
"datetime64[ns]",
5151
"timedelta64[ns]",
5252
]
5353
)
54-
def any_numpy_dtype_for_small_integer_indexes(request):
54+
def any_numpy_dtype_for_small_pos_integer_indexes(request):
5555
"""
56-
Dtypes that can be given to an Index with small integers.
56+
Dtypes that can be given to an Index with small positive integers.
5757
5858
This means that for any dtype `x` in the params list, `Index([1, 2, 3], dtype=x)` is
5959
valid and gives the correct Index (sub-)class.

pandas/tests/indexes/test_setops.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ def test_intersection_duplicates_all_indexes(index):
561561

562562

563563
def test_union_duplicate_index_subsets_of_each_other(
564-
any_numpy_dtype_for_small_integer_indexes,
564+
any_numpy_dtype_for_small_pos_integer_indexes,
565565
):
566566
# GH#31326
567-
dtype = any_numpy_dtype_for_small_integer_indexes
567+
dtype = any_numpy_dtype_for_small_pos_integer_indexes
568568
a = Index([1, 2, 2, 3], dtype=dtype)
569569
b = Index([3, 3, 4], dtype=dtype)
570570

@@ -578,10 +578,10 @@ def test_union_duplicate_index_subsets_of_each_other(
578578

579579

580580
def test_union_with_duplicate_index_and_non_monotonic(
581-
any_numpy_dtype_for_small_integer_indexes,
581+
any_numpy_dtype_for_small_pos_integer_indexes,
582582
):
583583
# GH#36289
584-
dtype = any_numpy_dtype_for_small_integer_indexes
584+
dtype = any_numpy_dtype_for_small_pos_integer_indexes
585585
a = Index([1, 0, 0], dtype=dtype)
586586
b = Index([0, 1], dtype=dtype)
587587
expected = Index([0, 0, 1], dtype=dtype)
@@ -622,10 +622,10 @@ def test_union_nan_in_both(dup):
622622

623623

624624
def test_union_with_duplicate_index_not_subset_and_non_monotonic(
625-
any_numpy_dtype_for_small_integer_indexes,
625+
any_numpy_dtype_for_small_pos_integer_indexes,
626626
):
627627
# GH#36289
628-
dtype = any_numpy_dtype_for_small_integer_indexes
628+
dtype = any_numpy_dtype_for_small_pos_integer_indexes
629629
a = Index([1, 0, 2], dtype=dtype)
630630
b = Index([0, 0, 1], dtype=dtype)
631631
expected = Index([0, 0, 1, 2], dtype=dtype)

0 commit comments

Comments
 (0)