Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-python/ujson/files: ujson-1.33-test-py3.patch
Date: Mon, 24 Feb 2014 08:43:59
Message-Id: 20140224084356.10C432004E@flycatcher.gentoo.org
1 jlec 14/02/24 08:43:56
2
3 Added: ujson-1.33-test-py3.patch
4 Log:
5 dev-python/ujson: Add py3.3 support
6
7 (Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
8
9 Revision Changes Path
10 1.1 dev-python/ujson/files/ujson-1.33-test-py3.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/ujson/files/ujson-1.33-test-py3.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/ujson/files/ujson-1.33-test-py3.patch?rev=1.1&content-type=text/plain
14
15 Index: ujson-1.33-test-py3.patch
16 ===================================================================
17 tests/tests.py | 8 +++++---
18 1 file changed, 5 insertions(+), 3 deletions(-)
19
20 diff --git a/tests/tests.py b/tests/tests.py
21 index d210bc6..71f8074 100644
22 --- a/tests/tests.py
23 +++ b/tests/tests.py
24 @@ -11,6 +11,7 @@ try:
25 except ImportError:
26 import simplejson as json
27 import math
28 +import nose
29 import platform
30 import sys
31 import time
32 @@ -24,9 +25,10 @@ from functools import partial
33
34 PY3 = (sys.version_info[0] >= 3)
35
36 -def _python_ver(skip_major, skip_minor=None):
37 +def _skip_if_python_ver(skip_major, skip_minor=None):
38 major, minor = sys.version_info[:2]
39 - return major == skip_major and (skip_minor is None or minor == skip_minor)
40 + if major == skip_major and (skip_minor is None or minor == skip_minor):
41 + raise nose.SkipTest
42
43 json_unicode = (json.dumps if sys.version_info[0] >= 3
44 else partial(json.dumps, encoding="utf-8"))
45 @@ -579,8 +581,8 @@ class UltraJSONTests(TestCase):
46 input = "-31337"
47 self.assertEquals (-31337, ujson.decode(input))
48
49 - #@unittest.skipIf(_python_ver(3), "No exception in Python 3")
50 def test_encodeUnicode4BytesUTF8Fail(self):
51 + _skip_if_python_ver(3)
52 input = "\xfd\xbf\xbf\xbf\xbf\xbf"
53 try:
54 enc = ujson.encode(input)