Skip to content

Commit

Permalink
Fix for Python 4
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Aug 27, 2019
1 parent c454978 commit 4b0eeb5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dateutil/test/test_isoparser.py
Expand Up @@ -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'))
Expand Down Expand Up @@ -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))

Expand Down
4 changes: 2 additions & 2 deletions dateutil/test/test_parser.py
Expand Up @@ -14,7 +14,7 @@

from ._common import TZEnvContext

from six import assertRaisesRegex, PY3
from six import assertRaisesRegex, PY2
from io import StringIO

import pytest
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions dateutil/test/test_rrule.py
Expand Up @@ -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 (
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 4b0eeb5

Please sign in to comment.