Repository: pandas-dev/pandas

Issue:
CI: use dateutil master
revert this https://github.com/pandas-dev/pandas/pull/18325

when #18141 is a bit more stable


Discussion:

Resolving patch:
diff --git a/pandas/conftest.py b/pandas/conftest.py
--- a/pandas/conftest.py
+++ b/pandas/conftest.py
@@ -1,9 +1,7 @@
 import pytest
 
-from distutils.version import LooseVersion
 import numpy
 import pandas
-import dateutil
 import pandas.util._test_decorators as td
 
 
@@ -68,14 +66,6 @@ def ip():
     return InteractiveShell()
 
 
-is_dateutil_le_261 = pytest.mark.skipif(
-    LooseVersion(dateutil.__version__) > LooseVersion('2.6.1'),
-    reason="dateutil api change version")
-is_dateutil_gt_261 = pytest.mark.skipif(
-    LooseVersion(dateutil.__version__) <= LooseVersion('2.6.1'),
-    reason="dateutil stable version")
-
-
 @pytest.fixture(params=[None, 'gzip', 'bz2', 'zip',
                         pytest.param('xz', marks=td.skip_if_no_lzma)])
 def compression(request):


Test patch:
diff --git a/pandas/tests/indexes/datetimes/test_tools.py b/pandas/tests/indexes/datetimes/test_tools.py
--- a/pandas/tests/indexes/datetimes/test_tools.py
+++ b/pandas/tests/indexes/datetimes/test_tools.py
@@ -12,7 +12,6 @@
 from distutils.version import LooseVersion
 
 import pandas as pd
-from pandas.conftest import is_dateutil_le_261, is_dateutil_gt_261
 from pandas._libs import tslib
 from pandas._libs.tslibs import parsing
 from pandas.core.tools import datetimes as tools
@@ -1058,7 +1057,6 @@ def test_dayfirst(self, cache):
 class TestGuessDatetimeFormat(object):
 
     @td.skip_if_not_us_locale
-    @is_dateutil_le_261
     def test_guess_datetime_format_for_array(self):
         expected_format = '%Y-%m-%d %H:%M:%S.%f'
         dt_string = datetime(2011, 12, 30, 0, 0, 0).strftime(expected_format)
@@ -1078,27 +1076,6 @@ def test_guess_datetime_format_for_array(self):
                 [np.nan, np.nan, np.nan], dtype='O'))
         assert format_for_string_of_nans is None
 
-    @td.skip_if_not_us_locale
-    @is_dateutil_gt_261
-    def test_guess_datetime_format_for_array_gt_261(self):
-        expected_format = '%Y-%m-%d %H:%M:%S.%f'
-        dt_string = datetime(2011, 12, 30, 0, 0, 0).strftime(expected_format)
-
-        test_arrays = [
-            np.array([dt_string, dt_string, dt_string], dtype='O'),
-            np.array([np.nan, np.nan, dt_string], dtype='O'),
-            np.array([dt_string, 'random_string'], dtype='O'),
-        ]
-
-        for test_array in test_arrays:
-            assert tools._guess_datetime_format_for_array(
-                test_array) is None
-
-        format_for_string_of_nans = tools._guess_datetime_format_for_array(
-            np.array(
-                [np.nan, np.nan, np.nan], dtype='O'))
-        assert format_for_string_of_nans is None
-
 
 class TestToDatetimeInferFormat(object):
 
diff --git a/pandas/tests/tslibs/test_parsing.py b/pandas/tests/tslibs/test_parsing.py
--- a/pandas/tests/tslibs/test_parsing.py
+++ b/pandas/tests/tslibs/test_parsing.py
@@ -8,7 +8,6 @@
 from dateutil.parser import parse
 
 import pandas.util._test_decorators as td
-from pandas.conftest import is_dateutil_le_261, is_dateutil_gt_261
 from pandas import compat
 from pandas.util import testing as tm
 from pandas._libs.tslibs import parsing
@@ -96,7 +95,6 @@ def test_parsers_monthfreq(self):
 class TestGuessDatetimeFormat(object):
 
     @td.skip_if_not_us_locale
-    @is_dateutil_le_261
     @pytest.mark.parametrize(
         "string, format",
         [
@@ -112,19 +110,6 @@ def test_guess_datetime_format_with_parseable_formats(
         result = parsing._guess_datetime_format(string)
         assert result == format
 
-    @td.skip_if_not_us_locale
-    @is_dateutil_gt_261
-    @pytest.mark.parametrize(
-        "string",
-        ['20111230', '2011-12-30', '30-12-2011',
-         '2011-12-30 00:00:00', '2011-12-30T00:00:00',
-         '2011-12-30 00:00:00.000000'])
-    def test_guess_datetime_format_with_parseable_formats_gt_261(
-            self, string):
-        result = parsing._guess_datetime_format(string)
-        assert result is None
-
-    @is_dateutil_le_261
     @pytest.mark.parametrize(
         "dayfirst, expected",
         [
@@ -136,17 +121,7 @@ def test_guess_datetime_format_with_dayfirst(self, dayfirst, expected):
             ambiguous_string, dayfirst=dayfirst)
         assert result == expected
 
-    @is_dateutil_gt_261
-    @pytest.mark.parametrize(
-        "dayfirst", [True, False])
-    def test_guess_datetime_format_with_dayfirst_gt_261(self, dayfirst):
-        ambiguous_string = '01/01/2011'
-        result = parsing._guess_datetime_format(
-            ambiguous_string, dayfirst=dayfirst)
-        assert result is None
-
     @td.skip_if_has_locale
-    @is_dateutil_le_261
     @pytest.mark.parametrize(
         "string, format",
         [
@@ -158,19 +133,6 @@ def test_guess_datetime_format_with_locale_specific_formats(
         result = parsing._guess_datetime_format(string)
         assert result == format
 
-    @td.skip_if_has_locale
-    @is_dateutil_gt_261
-    @pytest.mark.parametrize(
-        "string",
-        [
-            '30/Dec/2011',
-            '30/December/2011',
-            '30/Dec/2011 00:00:00'])
-    def test_guess_datetime_format_with_locale_specific_formats_gt_261(
-            self, string):
-        result = parsing._guess_datetime_format(string)
-        assert result is None
-
     def test_guess_datetime_format_invalid_inputs(self):
         # A datetime string must include a year, month and a day for it
         # to be guessable, in addition to being a string that looks like
@@ -189,7 +151,6 @@ def test_guess_datetime_format_invalid_inputs(self):
         for invalid_dt in invalid_dts:
             assert parsing._guess_datetime_format(invalid_dt) is None
 
-    @is_dateutil_le_261
     @pytest.mark.parametrize(
         "string, format",
         [
@@ -204,21 +165,6 @@ def test_guess_datetime_format_nopadding(self, string, format):
         result = parsing._guess_datetime_format(string)
         assert result == format
 
-    @is_dateutil_gt_261
-    @pytest.mark.parametrize(
-        "string",
-        [
-            '2011-1-1',
-            '30-1-2011',
-            '1/1/2011',
-            '2011-1-1 00:00:00',
-            '2011-1-1 0:0:0',
-            '2011-1-3T00:00:0'])
-    def test_guess_datetime_format_nopadding_gt_261(self, string):
-        # GH 11142
-        result = parsing._guess_datetime_format(string)
-        assert result is None
-
 
 class TestArrayToDatetime(object):
     def test_try_parse_dates(self):