Skip to content

Commit 605a837

Browse files
jbrockmendeljreback
authored andcommitted
move libfreqs and liboffsets tests to test_tslibs, move parsing tests, with to_datetime test moved to test_tools (pandas-dev#19638)
1 parent cd484cc commit 605a837

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

pandas/tests/indexes/datetimes/test_tools.py

+12
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,18 @@ def test_to_datetime_format_weeks(self, cache):
187187

188188

189189
class TestToDatetime(object):
190+
def test_to_datetime_pydatetime(self):
191+
actual = pd.to_datetime(datetime(2008, 1, 15))
192+
assert actual == datetime(2008, 1, 15)
193+
194+
def test_to_datetime_YYYYMMDD(self):
195+
actual = pd.to_datetime('20080115')
196+
assert actual == datetime(2008, 1, 15)
197+
198+
def test_to_datetime_unparseable_ignore(self):
199+
# unparseable
200+
s = 'Month 1, 1999'
201+
assert pd.to_datetime(s, errors='ignore') == s
190202

191203
@td.skip_if_windows # `tm.set_timezone` does not work in windows
192204
def test_to_datetime_now(self):

pandas/tests/scalar/test_parsing.py renamed to pandas/tests/tslibs/test_parsing.py

-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import pytest
88
from dateutil.parser import parse
99

10-
import pandas as pd
1110
import pandas.util._test_decorators as td
1211
from pandas.conftest import is_dateutil_le_261, is_dateutil_gt_261
1312
from pandas import compat
@@ -16,18 +15,6 @@
1615
from pandas._libs.tslibs.parsing import parse_time_string
1716

1817

19-
def test_to_datetime1():
20-
actual = pd.to_datetime(datetime(2008, 1, 15))
21-
assert actual == datetime(2008, 1, 15)
22-
23-
actual = pd.to_datetime('20080115')
24-
assert actual == datetime(2008, 1, 15)
25-
26-
# unparseable
27-
s = 'Month 1, 1999'
28-
assert pd.to_datetime(s, errors='ignore') == s
29-
30-
3118
class TestParseQuarters(object):
3219

3320
def test_parse_time_string(self):

0 commit comments

Comments
 (0)