Skip to content
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

Fix for Python 4 #950

Merged
merged 3 commits into from Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
hugovk marked this conversation as resolved.
Show resolved Hide resolved
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
hugovk marked this conversation as resolved.
Show resolved Hide resolved
self._rrulestr_reverse_test(rrule(MINUTELY,
count=long(2),
interval=long(2),
Expand Down