Skip to content

Commit

Permalink
Small changes to achieve Python 3 compatibility for Conformity. (#10)
Browse files Browse the repository at this point in the history
* Small changes to achieve Python 3 compatibility for Conformity.
  • Loading branch information
sethbrite authored Apr 13, 2017
1 parent d908b8e commit 8e96878
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions conformity/fields/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Integer(Base):
Accepts valid integers, with optional range limits.
"""

valid_type = (int, long)
valid_type = six.integer_types
valid_noun = "integer"
introspect_type = "integer"

Expand Down Expand Up @@ -167,7 +167,7 @@ class Float(Integer):
Accepts floating point numbers as well as integers.
"""

valid_type = (int, long, float)
valid_type = six.integer_types + (float,)
valid_noun = "float"
introspect_type = "float"

Expand Down
9 changes: 6 additions & 3 deletions conformity/tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ def test_polymorph(self):
)

def test_temporal(self):
past1985 = datetime.datetime(1985, 10, 26, 1, 21, 00)
past1955 = datetime.datetime(1955, 11, 12, 22, 04, 00)
past1985 = datetime.datetime(1985, 10, 26, 1, 21, 0)
past1955 = datetime.datetime(1955, 11, 12, 22, 4, 0)

datetime_schema = DateTime(gt=past1985)
date_schema = Date(gt=past1985.date())
Expand Down Expand Up @@ -353,7 +353,10 @@ def test_tuple(self):
[
Error('Value not > 0', pointer='0'),
Error('Not a unicode string', pointer='1'),
Error("Value is not u'I love tuples'", pointer='2'),
Error(
'Value is not %r' % 'I love tuples',
pointer='2',
),
]
)

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bdist_wheel]
universal=1

0 comments on commit 8e96878

Please sign in to comment.