Skip to content

Commit

Permalink
Skip localtime tests on Linux
Browse files Browse the repository at this point in the history
Due to different behavior of local time between OS's.
Not sure how to fix this yet.
  • Loading branch information
sloria committed Nov 11, 2013
1 parent 4568121 commit b1095c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ README.html

sandbox.ipynb
.ipynb_checkpoints

Vagrantfile
.vagrant
1 change: 1 addition & 0 deletions marshmallow/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

PY2 = int(sys.version[0]) == 2
PY26 = PY2 and int(sys.version_info[1]) < 7
LINUX = sys.platform.startswith("linux")

if PY2:
text_type = unicode
Expand Down
7 changes: 5 additions & 2 deletions tests/test_marshmallow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytz

from marshmallow import Serializer, fields, types
from marshmallow.compat import unicode
from marshmallow.compat import LINUX

central = pytz.timezone("US/Central")

Expand Down Expand Up @@ -111,6 +111,7 @@ def test_tz_datetime_field(self):
assert_equal(self.serialized.data['updated'],
'Sun, 10 Nov 2013 20:20:58 -0000')

@unittest.skipIf(LINUX, "Skip due to different localtime behavior on Linux")
def test_local_datetime_field(self):
assert_equal(self.serialized.data['updated_local'],
'Sun, 10 Nov 2013 14:20:58 -0600')
Expand Down Expand Up @@ -180,11 +181,13 @@ def test_rfc822_gmt_naive(self):
d = dt.datetime(2013, 11, 10, 1, 23, 45)
assert_equal(types.rfc822(d), "Sun, 10 Nov 2013 01:23:45 -0000")

@unittest.skipIf(LINUX, "Skip due to different localtime behavior on Linux")
def test_rfc822_central(self):
d = central.localize(dt.datetime(2013, 11, 10, 1, 23, 45), is_dst=False)
assert_equal(types.rfc822(d), 'Sun, 10 Nov 2013 07:23:45 -0000')

def test_rfc822_cental_localized(self):
@unittest.skipIf(LINUX, "Skip due to different localtime behavior on Linux")
def test_rfc822_central_localized(self):
d = central.localize(dt.datetime(2013, 11, 10, 8, 23, 45), is_dst=False)
assert_equal(types.rfc822(d, localtime=True), "Sun, 10 Nov 2013 08:23:45 -0600")

Expand Down

0 comments on commit b1095c1

Please sign in to comment.