From 1123b7db4c613e28d16ae845abbba64255e9a978 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Fri, 15 May 2015 11:47:54 -0700 Subject: [PATCH] Fix validate test fail due to bytes/hex change In python3 we don't have the same freedom with hex decoding that we had before. This test is less elegant now, but still readable. --- tests/test_13_validate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_13_validate.py b/tests/test_13_validate.py index 6722b6a..5bf9415 100644 --- a/tests/test_13_validate.py +++ b/tests/test_13_validate.py @@ -56,7 +56,11 @@ def test_valid_non_negative_integer(): def test_valid_string(): assert valid_string(u'example') - raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))') + import codecs + + raises(NotValid, + 'valid_string(codecs.getdecoder("hex_codec")' + '(b"02656c6c6f")[0].decode("utf-8"))') def test_valid_anyuri():