[pypy-commit] pypy py3k: Fix test_unicodeobject, and remove two 'itertools' that are not useful anymore.

amauryfa noreply at buildbot.pypy.org
Tue Nov 6 22:08:10 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r58767:f7c2bf7d732f
Date: 2012-11-06 22:06 +0100
http://bitbucket.org/pypy/pypy/changeset/f7c2bf7d732f/

Log:	Fix test_unicodeobject, and remove two 'itertools' that are not
	useful anymore.

diff --git a/pypy/module/_socket/test/test_sock_app.py b/pypy/module/_socket/test/test_sock_app.py
--- a/pypy/module/_socket/test/test_sock_app.py
+++ b/pypy/module/_socket/test/test_sock_app.py
@@ -6,7 +6,7 @@
 from pypy.rpython.lltypesystem import lltype, rffi
 
 def setup_module(mod):
-    mod.space = gettestobjspace(usemodules=['_socket', 'array', 'struct', 'itertools'])
+    mod.space = gettestobjspace(usemodules=['_socket', 'array', 'struct'])
     global socket
     import socket
     mod.w_socket = space.appexec([], "(): import _socket as m; return m")
diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -14,11 +14,10 @@
 
 def setup_module(mod):
     if os.name != 'nt':
-        mod.space = gettestobjspace(usemodules=['posix', 'fcntl', 'struct', 'itertools'])
+        mod.space = gettestobjspace(usemodules=['posix', 'fcntl', 'struct'])
     else:
         # On windows, os.popen uses the subprocess module
-        mod.space = gettestobjspace(usemodules=['posix', '_rawffi', 'thread', 'struct',
-                                                'itertools'])
+        mod.space = gettestobjspace(usemodules=['posix', '_rawffi', 'thread', 'struct'])
     mod.path = udir.join('posixtestfile.txt')
     mod.path.write("this is a test")
     mod.path2 = udir.join('test_posix2-')
diff --git a/pypy/objspace/std/test/test_unicodeobject.py b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -2,16 +2,18 @@
 import py
 import sys
 
-def test_unicode_to_decimal_w():
-    from pypy.objspace.std.unicodeobject import unicode_to_decimal_w
-    space = gettestobjspace(usemodules=('unicodedata',))
-    w_s = space.wrap(u"\N{EM SPACE}-3\N{EN SPACE}")
-    s2 = unicode_to_decimal_w(space, w_s)
-    assert s2 == " -3 "
-    #
-    w_s = space.wrap(u'\U0001D7CF\U0001D7CE') # 𝟏𝟎
-    s2 = unicode_to_decimal_w(space, w_s)
-    assert s2 == "10"
+class TestUnicodeObject:
+    spaceconfig = dict(usemodules=('unicodedata',))
+
+    def test_unicode_to_decimal_w(self, space):
+        from pypy.objspace.std.unicodeobject import unicode_to_decimal_w
+        w_s = space.wrap(u"\N{EM SPACE}-3\N{EN SPACE}")
+        s2 = unicode_to_decimal_w(space, w_s)
+        assert s2 == " -3 "
+        #
+        w_s = space.wrap(u'\U0001D7CF\U0001D7CE') # 𝟏𝟎
+        s2 = unicode_to_decimal_w(space, w_s)
+        assert s2 == "10"
 
     def test_listview_unicode(self):
         w_str = self.space.wrap(u'abcd')


More information about the pypy-commit mailing list