Skip to content

Commit

Permalink
Incorporate feedback:
Browse files Browse the repository at this point in the history
- Spacing in test_equality.
- Better spelling for chr(129).
- Directly import OrderedDict.
  • Loading branch information
jamadden committed Sep 15, 2016
1 parent 1d3f1c4 commit 6e73964
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
6 changes: 0 additions & 6 deletions src/zope/schema/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

PY3 = sys.version_info[0] >= 3

from collections import OrderedDict

# pep 8 friendlyness
OrderedDict


if PY3: # pragma: no cover

string_types = str,
Expand Down
5 changes: 1 addition & 4 deletions src/zope/schema/tests/test__field.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ def test_validate_required(self):
def test_fromUnicode_miss(self):
from zope.schema._compat import text_type
byt = self._makeOne()
u = chr(129)
if not isinstance(u, text_type):
u = text_type(u, 'unicode_escape') # PY2
self.assertRaises(UnicodeEncodeError, byt.fromUnicode, u)
self.assertRaises(UnicodeEncodeError, byt.fromUnicode, u'\x81')

def test_fromUnicode_hit(self):

Expand Down
2 changes: 1 addition & 1 deletion src/zope/schema/tests/test_equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_equality(self):
def _makeOne(cls):
return cls(title=u"Foo", description=u"Bar")

for cls in Int,Text:
for cls in (Int, Text):
self.assertEqual(_makeOne(cls), _makeOne(cls))


Expand Down
2 changes: 1 addition & 1 deletion src/zope/schema/tests/test_vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def test_ordering(self):
#internal tree representation.
#
#Check that they keys are indeed oredered.
from zope.schema._compat import OrderedDict
from collections import OrderedDict

d = {
(1, 'new_york', 'New York'): {
Expand Down
2 changes: 1 addition & 1 deletion src/zope/schema/vocabulary.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from zope.schema.interfaces import ITreeVocabulary
from zope.schema.interfaces import IVocabularyRegistry
from zope.schema.interfaces import IVocabularyTokenized
from zope.schema._compat import OrderedDict
from collections import OrderedDict

# simple vocabularies performing enumerated-like tasks
_marker = object()
Expand Down

0 comments on commit 6e73964

Please sign in to comment.