Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: add test coverage for maybe_promote #23982

Merged
merged 11 commits into from
Oct 11, 2019
10 changes: 10 additions & 0 deletions pandas/tests/dtypes/cast/test_promote.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,16 @@ def test_maybe_promote_bytes_with_any(bytes_dtype, any_numpy_dtype_reduced, box)
)


# override parametrization of box to add special case for bytes
@pytest.mark.parametrize(
"box",
[
(True, None), # fill_value wrapped in array with auto-dtype (fixed len)
(True, "bytes"), # fill_value wrapped in array with generic bytes-dtype
(True, object), # fill_value wrapped in array with object dtype
(False, None), # fill_value directly
],
)
def test_maybe_promote_any_with_bytes(any_numpy_dtype_reduced, bytes_dtype, box):
dtype = np.dtype(any_numpy_dtype_reduced)
fill_dtype = np.dtype(bytes_dtype)
Expand Down