diff --git a/dateutil/test/test_isoparser.py b/dateutil/test/test_isoparser.py index ebe16c400..e81db3a4a 100644 --- a/dateutil/test/test_isoparser.py +++ b/dateutil/test/test_isoparser.py @@ -306,7 +306,7 @@ def test_isoparser_invalid_sep(sep): # This only fails on Python 3 -@pytest.mark.xfail(six.PY3, reason="Fails on Python 3 only") +@pytest.mark.xfail(not six.PY2, reason="Fails on Python 3 only") def test_isoparser_byte_sep(): dt = datetime(2017, 12, 6, 12, 30, 45) dt_str = dt.isoformat(sep=str('T')) @@ -356,7 +356,7 @@ def __make_date_examples(): date(2016, 2, 1) ] - if six.PY3: + if not six.PY2: # strftime does not support dates before 1900 in Python 2 dates_no_day.append(date(1000, 11, 1)) diff --git a/dateutil/test/test_parser.py b/dateutil/test/test_parser.py index 6cdc27f3f..a5e0a4784 100644 --- a/dateutil/test/test_parser.py +++ b/dateutil/test/test_parser.py @@ -14,7 +14,7 @@ from ._common import TZEnvContext -from six import assertRaisesRegex, PY3 +from six import assertRaisesRegex, PY2 from io import StringIO import pytest @@ -462,7 +462,7 @@ def testDateCommandFormatReversed(self): tzinfo=self.brsttz)) def testDateCommandFormatWithLong(self): - if not PY3: + if PY2: self.assertEqual(parse("Thu Sep 25 10:36:28 BRST 2003", tzinfos={"BRST": long(-10800)}), datetime(2003, 9, 25, 10, 36, 28, diff --git a/dateutil/test/test_rrule.py b/dateutil/test/test_rrule.py index 9dfa5444b..b22a32960 100644 --- a/dateutil/test/test_rrule.py +++ b/dateutil/test/test_rrule.py @@ -4,7 +4,7 @@ from datetime import datetime, date import unittest -from six import PY3 +from six import PY2 from dateutil import tz from dateutil.rrule import ( @@ -2284,7 +2284,7 @@ def testSecondlyByHourAndMinuteAndSecondBug(self): datetime(2010, 3, 22, 14, 1)]) def testLongIntegers(self): - if not PY3: # There is no longs in python3 + if PY2: # There is no longs in python3 self.assertEqual(list(rrule(MINUTELY, count=long(2), interval=long(2), @@ -4579,7 +4579,7 @@ def testToStrWithWkSt(self): dtstart=datetime(1997, 9, 2, 9, 0))) def testToStrLongIntegers(self): - if not PY3: # There is no longs in python3 + if PY2: # There is no longs in python3 self._rrulestr_reverse_test(rrule(MINUTELY, count=long(2), interval=long(2),