Author: Konstantin Lopuhin <[email protected]>
Branch:
Changeset: r58429:cb3d6f20e44c
Date: 2012-07-21 00:05 +0400
http://bitbucket.org/pypy/pypy/changeset/cb3d6f20e44c/
Log: add test for invalid float argument and for nan
diff --git a/pypy/objspace/std/test/test_bytearrayobject.py
b/pypy/objspace/std/test/test_bytearrayobject.py
--- a/pypy/objspace/std/test/test_bytearrayobject.py
+++ b/pypy/objspace/std/test/test_bytearrayobject.py
@@ -443,6 +443,9 @@
assert float(bytearray(b'10.4')) == 10.4
assert float(bytearray('-1.7e-1')) == -1.7e-1
assert float(bytearray(u'.9e10', 'utf-8')) == .9e10
+ import math
+ assert math.isnan(float(bytearray('nan')))
+ raises(ValueError, float, bytearray('not_a_number'))
def test_reduce(self):
assert bytearray('caf\xe9').__reduce__() == (
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit