[pypy-svn] r50712 - pypy/dist/pypy/module/struct/test
arigo at codespeak.net
arigo at codespeak.net
Thu Jan 17 17:42:31 CET 2008
Author: arigo
Date: Thu Jan 17 17:42:31 2008
New Revision: 50712
Modified:
pypy/dist/pypy/module/struct/test/test_ieee.py
Log:
CPython 2.4's struct module doesn't fully support 'inf' and 'nan'.
Modified: pypy/dist/pypy/module/struct/test/test_ieee.py
==============================================================================
--- pypy/dist/pypy/module/struct/test/test_ieee.py (original)
+++ pypy/dist/pypy/module/struct/test/test_ieee.py Thu Jan 17 17:42:31 2008
@@ -1,5 +1,6 @@
+import sys
from pypy.module.struct.ieee import pack_float, unpack_float
-from pypy.rlib.rarithmetic import isnan
+from pypy.rlib.rarithmetic import isinf, isnan
testcases = [
(-0.025, 4, False, '\xcd\xcc\xcc\xbc'),
@@ -22,6 +23,8 @@
def test_correct_tests():
import struct
for number, size, bigendian, expected in testcases:
+ if sys.version < (2, 5) and (isinf(number) or isnan(number)):
+ continue # 'inf' and 'nan' unsupported in CPython 2.4's struct
if bigendian:
fmt = '>'
else:
More information about the Pypy-commit
mailing list