summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kögl <stefan@skoegl.net>2017-12-31 14:27:44 +0100
committerStefan Kögl <stefan@skoegl.net>2017-12-31 14:27:44 +0100
commit637f0c7a4c0e0bee1d54899ab95d93fc9a3f7c20 (patch)
treec7e67ea6b94ec7b2199da45529071bce1e9b29b6
parentfce420c02144aaac619f04311c2872b53e0f8f69 (diff)
downloadpython-json-patch-637f0c7a4c0e0bee1d54899ab95d93fc9a3f7c20.tar.gz
Prefer Python3 when distinguishing str/unicode
-rwxr-xr-xtests.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests.py b/tests.py
index 55496ab..e1b4300 100755
--- a/tests.py
+++ b/tests.py
@@ -18,9 +18,9 @@ except ImportError:
hypothesis = None
try:
- unicode
+ str = unicode # Python 2
except NameError:
- unicode = str
+ pass
class ApplyPatchTestCase(unittest.TestCase):
@@ -632,8 +632,8 @@ if hypothesis is not None:
| 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)