summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Seligmann <mithrandi@mithrandi.net>2017-07-06 16:25:01 +0200
committerTristan Seligmann <mithrandi@mithrandi.net>2017-07-06 16:25:01 +0200
commit6f107152a1c7f04c6eee9098e34ed777d6ddff74 (patch)
tree80001ae2ff76341dc75ed9772edecf539aa7ba2e
parent6cc61b1f646edac4ed90929b18143da1515e813d (diff)
downloadpython-json-patch-6f107152a1c7f04c6eee9098e34ed777d6ddff74.tar.gz
Fix 3.2 compat.
-rwxr-xr-xtests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests.py b/tests.py
index 0ba2488..7e79202 100755
--- a/tests.py
+++ b/tests.py
@@ -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)