[pypy-svn] r47000 - in pypy/dist/lib-python: . modified-2.4.1/test

arigo at codespeak.net arigo at codespeak.net
Fri Sep 28 12:15:45 CEST 2007


Author: arigo
Date: Fri Sep 28 12:15:45 2007
New Revision: 47000

Modified:
   pypy/dist/lib-python/conftest.py
   pypy/dist/lib-python/modified-2.4.1/test/test_struct.py
Log:
Adaptations for the struct module.  Also mention the zlib module.


Modified: pypy/dist/lib-python/conftest.py
==============================================================================
--- pypy/dist/lib-python/conftest.py	(original)
+++ pypy/dist/lib-python/conftest.py	Fri Sep 28 12:15:45 2007
@@ -679,7 +679,7 @@
     RegrTest('test_strptime.py', enabled=False),
         #rev 10840: 1 of 42 test fails: seems to be some regex problem
 
-    RegrTest('test_struct.py', enabled=False, dumbtest=1),
+    RegrTest('test_struct.py', enabled=True, dumbtest=1, usemodules='struct'),
     RegrTest('test_structseq.py', enabled=False, dumbtest=1),
     RegrTest('test_subprocess.py', enabled=False),
     RegrTest('test_sunaudiodev.py', enabled=False, dumbtest=1),
@@ -759,12 +759,8 @@
     RegrTest('test_xpickle.py', enabled=False),
     RegrTest('test_xrange.py', enabled=True, core=True),
     RegrTest('test_zipfile.py', enabled=False, dumbtest=1),
-    RegrTest('test_zipimport.py', enabled=True),
-        # considered non-core because it depends on 'import zlib'
-        # which we don't have
-
-    RegrTest('test_zlib.py', enabled=False),
-        #10840: ImportError: zlib
+    RegrTest('test_zipimport.py', enabled=True, usemodules='zlib'),
+    RegrTest('test_zlib.py', enabled=True, usemodules='zlib'),
 ]
 
 class RegrDirectory(py.test.collect.Directory): 

Modified: pypy/dist/lib-python/modified-2.4.1/test/test_struct.py
==============================================================================
--- pypy/dist/lib-python/modified-2.4.1/test/test_struct.py	(original)
+++ pypy/dist/lib-python/modified-2.4.1/test/test_struct.py	Fri Sep 28 12:15:45 2007
@@ -30,7 +30,7 @@
 def any_err(func, *args):
     try:
         func(*args)
-    except (struct.error, OverflowError, TypeError):
+    except (struct.error, OverflowError, TypeError, ValueError):
         pass
     else:
         raise TestFailed, "%s%s did not raise error" % (
@@ -53,9 +53,9 @@
 
 simple_err(struct.pack, 'iii', 3)
 simple_err(struct.pack, 'i', 3, 3, 3)
-simple_err(struct.pack, 'i', 'foo')
-simple_err(struct.pack, 'P', 'foo')
-simple_err(struct.unpack, 'd', 'flap')
+any_err(struct.pack, 'i', 'foo')
+any_err(struct.pack, 'P', 'foo')
+any_err(struct.unpack, 'd', 'flap')
 s = struct.pack('ii', 1, 2)
 simple_err(struct.unpack, 'iii', s)
 simple_err(struct.unpack, 'i', s)
@@ -150,8 +150,8 @@
     print "Platform has native q/Q?", has_native_qQ and "Yes." or "No."
 
 any_err(struct.pack, "Q", -1)   # can't pack -1 as unsigned regardless
-simple_err(struct.pack, "q", "a")  # can't pack string as 'q' regardless
-simple_err(struct.pack, "Q", "a")  # ditto, but 'Q'
+any_err(struct.pack, "q", "a")  # can't pack string as 'q' regardless
+any_err(struct.pack, "Q", "a")  # ditto, but 'Q'
 
 def test_native_qQ():
     bytes = struct.calcsize('q')



More information about the Pypy-commit mailing list