Skip to content

Move liboffsets, libfreqs, libparsing tests to test_tslibs #19638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pandas/tests/indexes/datetimes/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@ def test_to_datetime_format_weeks(self, cache):


class TestToDatetime(object):
def test_to_datetime_pydatetime(self):
actual = pd.to_datetime(datetime(2008, 1, 15))
assert actual == datetime(2008, 1, 15)

def test_to_datetime_YYYYMMDD(self):
actual = pd.to_datetime('20080115')
assert actual == datetime(2008, 1, 15)

def test_to_datetime_unparseable_ignore(self):
# unparseable
s = 'Month 1, 1999'
assert pd.to_datetime(s, errors='ignore') == s

@td.skip_if_windows # `tm.set_timezone` does not work in windows
def test_to_datetime_now(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import pytest
from dateutil.parser import parse

import pandas as pd
import pandas.util._test_decorators as td
from pandas.conftest import is_dateutil_le_261, is_dateutil_gt_261
from pandas import compat
Expand All @@ -16,18 +15,6 @@
from pandas._libs.tslibs.parsing import parse_time_string


def test_to_datetime1():
actual = pd.to_datetime(datetime(2008, 1, 15))
assert actual == datetime(2008, 1, 15)

actual = pd.to_datetime('20080115')
assert actual == datetime(2008, 1, 15)

# unparseable
s = 'Month 1, 1999'
assert pd.to_datetime(s, errors='ignore') == s


class TestParseQuarters(object):

def test_parse_time_string(self):
Expand Down