Skip to content

Commit 91dcd7a

Browse files
committed
Make test_astype_str more specific
1 parent e323274 commit 91dcd7a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/tests/test_series.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -5435,12 +5435,14 @@ def test_astype_str(self):
54355435

54365436
# GH9757
54375437
ts = Series([Timestamp('2010-01-04 00:00:00')])
5438-
ts = ts.astype(str)
5439-
self.assertEqual(ts.dtype, np.object_)
5438+
s = ts.astype(str)
5439+
expected = Series([str(ts.values[0])])
5440+
assert_series_equal(s, expected)
54405441

54415442
td = Series([Timedelta(1, unit='d')])
5442-
td = td.astype(str)
5443-
self.assertEqual(td.dtype, np.object_)
5443+
s = td.astype(str)
5444+
expected = Series([str(td.values[0])])
5445+
assert_series_equal(s, expected)
54445446

54455447
def test_astype_unicode(self):
54465448

0 commit comments

Comments
 (0)