diff options
author | Tristan Seligmann <mithrandi@mithrandi.net> | 2017-07-06 16:25:01 +0200 |
---|---|---|
committer | Tristan Seligmann <mithrandi@mithrandi.net> | 2017-07-06 16:25:01 +0200 |
commit | 6f107152a1c7f04c6eee9098e34ed777d6ddff74 (patch) | |
tree | 80001ae2ff76341dc75ed9772edecf539aa7ba2e | |
parent | 6cc61b1f646edac4ed90929b18143da1515e813d (diff) | |
download | python-json-patch-6f107152a1c7f04c6eee9098e34ed777d6ddff74.tar.gz |
Fix 3.2 compat.
-rwxr-xr-x | tests.py | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -10,12 +10,18 @@ import jsonpatch import jsonpointer import sys import string + try: import hypothesis from hypothesis import strategies as st except ImportError: hypothesis = None +try: + unicode +except NameError: + unicode = str + class ApplyPatchTestCase(unittest.TestCase): @@ -536,8 +542,8 @@ if hypothesis is not None: | st.dictionaries(st.text(string.printable), children)) class RoundtripTests(unittest.TestCase): - @hypothesis.example({}, {u'%20': None}) - @hypothesis.example({u'%20': None}, {}) + @hypothesis.example({}, {unicode('%20'): None}) + @hypothesis.example({unicode('%20'): None}, {}) @hypothesis.given(json_st, json_st) def test_roundtrip(self, src, dst): patch = jsonpatch.JsonPatch.from_diff(src, dst, False) |