Skip to content

Commit 3f6530c

Browse files
committed
TST: check tzinfos in boxed values, close #1345
1 parent 2e95a0f commit 3f6530c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tseries/tests/test_timezones.py

+16
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,22 @@ def test_index_with_timezone_repr(self):
251251
rng_repr = repr(rng)
252252
self.assert_('2010-04-13 00:00:00' in rng_repr)
253253

254+
def test_index_astype_asobject_tzinfos(self):
255+
# #1345
256+
rng = date_range('4/13/2010', '5/6/2010', tz='US/Eastern')
257+
258+
objs = rng.asobject
259+
for i, x in enumerate(objs):
260+
exval = rng[i]
261+
self.assertEquals(x, exval)
262+
self.assertEquals(x.tzinfo, exval.tzinfo)
263+
264+
objs = rng.astype(object)
265+
for i, x in enumerate(objs):
266+
exval = rng[i]
267+
self.assertEquals(x, exval)
268+
self.assertEquals(x.tzinfo, exval.tzinfo)
269+
254270
class TestTimeZones(unittest.TestCase):
255271

256272
def setUp(self):

0 commit comments

Comments
 (0)