Skip to content

Commit 1fd2be9

Browse files
TST: assure test_update_preserve_dtype checks dtype
1 parent d7f63a1 commit 1fd2be9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/tests/frame/methods/test_update.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ def test_update_dt_column_with_NaT_create_column(self):
190190
[
191191
(True, False, bool),
192192
(1, 2, int),
193-
(np.uint64(1), np.uint(2), np.dtype("uint64")),
194193
(1.0, 2.0, float),
195194
(1.0 + 1j, 2.0 + 2j, complex),
195+
(np.uint64(1), np.uint(2), np.dtype("ubyte")),
196+
(np.uint64(1), np.uint(2), np.dtype("int_")),
196197
("a", "b", pd.StringDtype()),
197198
(
198199
pd.to_timedelta("1 ms"),
@@ -208,9 +209,9 @@ def test_update_dt_column_with_NaT_create_column(self):
208209
)
209210
def test_update_preserve_dtype(self, value_df, value_other, dtype):
210211
# GH#55509
211-
df = DataFrame({"a": [value_df] * 2}, index=[1, 2])
212-
other = DataFrame({"a": [value_other]}, index=[1])
213-
expected = DataFrame({"a": [value_other, value_df]}, index=[1, 2])
212+
df = DataFrame({"a": [value_df] * 2}, index=[1, 2], dtype=dtype)
213+
other = DataFrame({"a": [value_other]}, index=[1], dtype=dtype)
214+
expected = DataFrame({"a": [value_other, value_df]}, index=[1, 2], dtype=dtype)
214215
df.update(other)
215216
tm.assert_frame_equal(df, expected)
216217

0 commit comments

Comments
 (0)