Commits

Alex Gaynor committed 699f60d

Fixed bz2 tests

Comments (0)

Files changed (3)

pypy/module/_ffi/test/test_struct.py

             lst = [array[i] for i in range(length)]
             return space.wrap(lst)
         if cls.runappdirect:
-            cls.w_read_raw_mem = lambda self, addr, typename, length: read_raw_mem(cls.space, addr, typename, length)
+            cls.w_read_raw_mem = lambda self, *args: read_raw_mem(cls.space, *args)
         else:
             cls.w_read_raw_mem = cls.space.wrap(interp2app(read_raw_mem))
         #

pypy/module/bz2/test/test_bz2_compdecomp.py

 
     def setup_class(cls):
         cls.w_TEXT = cls.space.wrap(TEXT)
-        cls.w_decompress = cls.space.wrap(interp2app(decompress))
+        if cls.runappdirect:
+            cls.w_decompress = lambda self, *args: decompress(cls.space, *args)
+        else:
+            cls.w_decompress = cls.space.wrap(interp2app(decompress))
         cls.w_HUGE_OK = cls.space.wrap(HUGE_OK)
 
     def test_creation(self):
     def setup_class(cls):
         cls.w_TEXT = cls.space.wrap(TEXT)
         cls.w_DATA = cls.space.wrap(DATA)
-        cls.w_decompress = cls.space.wrap(interp2app(decompress))
+        if cls.runappdirect:
+            cls.w_decompress = lambda self, *args: decompress(cls.space, *args)
+        else:
+            cls.w_decompress = cls.space.wrap(interp2app(decompress))
         cls.w_HUGE_OK = cls.space.wrap(HUGE_OK)
 
     def test_compress_function(self):

pypy/module/bz2/test/test_bz2_file.py

             str(py.test.ensuretemp("bz2").join("foo")))
         if cls.runappdirect:
             cls.w_create_temp_file = create_temp_file
+            cls.w_create_broken_temp_file = lambda self: create_broken_temp_file()
+            cls.w_decompress = lambda self, *args: decompress(cls.space, *args)
         else:
             cls.w_create_temp_file = cls.space.wrap(interp2app(create_temp_file))
-        cls.w_decompress = cls.space.wrap(interp2app(decompress))
-        cls.w_create_broken_temp_file = cls.space.wrap(interp2app(create_broken_temp_file))
+            cls.w_create_broken_temp_file = cls.space.wrap(interp2app(create_broken_temp_file))
+            cls.w_decompress = cls.space.wrap(interp2app(decompress))
         cls.w_random_data = cls.space.wrap(RANDOM_DATA)
 
     def test_attributes(self):