@@ -193,16 +193,14 @@ def test_constructor_positional(self):
193
193
with tm .assertRaises (ValueError ):
194
194
Timestamp (2000 , 1 , 32 )
195
195
196
- ts = Timestamp (2000 , 1 , 2 )
197
-
198
- actual = ts .to_pydatetime ()
199
- expected = datetime .datetime (2000 , 1 , 2 )
200
- self .assertEqual (actual , expected )
201
- self .assertEqual (type (actual ), type (expected ))
196
+ # GH 11630
197
+ self .assertEqual (
198
+ repr (Timestamp (2015 , 11 , 12 )),
199
+ repr (Timestamp ('20151112' )))
202
200
203
- pos_args = [ 2000 , 1 , 2 , 3 , 4 , 5 , 999999 ]
204
- self . assertEqual (Timestamp (* pos_args ). to_pydatetime ( ),
205
- datetime . datetime ( * pos_args ))
201
+ self . assertEqual (
202
+ repr (Timestamp (2015 , 11 , 12 , 1 , 2 , 3 , 999999 ) ),
203
+ repr ( Timestamp ( '2015-11-12 01:02:03.999999' ) ))
206
204
207
205
def test_constructor_keyword (self ):
208
206
# GH 10758
@@ -217,25 +215,14 @@ def test_constructor_keyword(self):
217
215
with tm .assertRaises (ValueError ):
218
216
Timestamp (year = 2000 , month = 1 , day = 32 )
219
217
220
- ts = Timestamp (year = 2000 , month = 1 , day = 2 )
221
-
222
- actual = ts .to_pydatetime ()
223
- expected = datetime .datetime (year = 2000 , month = 1 , day = 2 )
224
- self .assertEqual (actual , expected )
225
- self .assertEqual (type (actual ), type (expected ))
226
-
227
- pos_args = [2000 , 1 , 2 , 3 , 4 , 5 , 999999 ]
228
- kw_args = {
229
- 'year' : 2000 ,
230
- 'month' : 1 ,
231
- 'day' : 2 ,
232
- 'hour' : 3 ,
233
- 'minute' : 4 ,
234
- 'second' : 5 ,
235
- 'microsecond' : 999999 ,
236
- }
237
- self .assertEqual (Timestamp (** kw_args ).to_pydatetime (),
238
- datetime .datetime (** kw_args ))
218
+ self .assertEqual (
219
+ repr (Timestamp (year = 2015 , month = 11 , day = 12 )),
220
+ repr (Timestamp ('20151112' )))
221
+
222
+ self .assertEqual (
223
+ repr (Timestamp (year = 2015 , month = 11 , day = 12 ,
224
+ hour = 1 , minute = 2 , second = 3 , microsecond = 999999 )),
225
+ repr (Timestamp ('2015-11-12 01:02:03.999999' )))
239
226
240
227
def test_conversion (self ):
241
228
# GH 9255
0 commit comments