Skip to content

Commit

Permalink
Prefer Python3 when distinguishing str/unicode
Browse files Browse the repository at this point in the history
  • Loading branch information
stefankoegl committed Dec 31, 2017
1 parent fce420c commit 637f0c7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
hypothesis = None

try:
unicode
str = unicode # Python 2
except NameError:
unicode = str
pass


class ApplyPatchTestCase(unittest.TestCase):
Expand Down Expand Up @@ -632,8 +632,8 @@ def test_replace_missing(self):
| st.dictionaries(st.text(string.printable), children))

class RoundtripTests(unittest.TestCase):
@hypothesis.example({}, {unicode('%20'): None})
@hypothesis.example({unicode('%20'): None}, {})
@hypothesis.example({}, {str('%20'): None})
@hypothesis.example({str('%20'): None}, {})
@hypothesis.given(json_st, json_st)
def test_roundtrip(self, src, dst):
patch = jsonpatch.JsonPatch.from_diff(src, dst, False)
Expand Down

0 comments on commit 637f0c7

Please sign in to comment.