Skip to content

Commit 894eac6

Browse files
h-vetinarijreback
authored andcommitted
TST: add test coverage for maybe_promote (#23982)
1 parent 3fba92e commit 894eac6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/dtypes/cast/test_promote.py

+10
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,16 @@ def test_maybe_promote_bytes_with_any(bytes_dtype, any_numpy_dtype_reduced, box)
504504
)
505505

506506

507+
# override parametrization of box to add special case for bytes
508+
@pytest.mark.parametrize(
509+
"box",
510+
[
511+
(True, None), # fill_value wrapped in array with auto-dtype (fixed len)
512+
(True, "bytes"), # fill_value wrapped in array with generic bytes-dtype
513+
(True, object), # fill_value wrapped in array with object dtype
514+
(False, None), # fill_value directly
515+
],
516+
)
507517
def test_maybe_promote_any_with_bytes(any_numpy_dtype_reduced, bytes_dtype, box):
508518
dtype = np.dtype(any_numpy_dtype_reduced)
509519
fill_dtype = np.dtype(bytes_dtype)

0 commit comments

Comments
 (0)