[Python-3000-checkins] r45428 - python/branches/p3yk/Lib/test/test_getargs2.py
thomas.wouters
python-3000-checkins at python.org
Sat Apr 15 11:15:11 CEST 2006
Author: thomas.wouters
Date: Sat Apr 15 11:15:11 2006
New Revision: 45428
Modified:
python/branches/p3yk/Lib/test/test_getargs2.py
Log:
Fix tests for PyArg_Parse*; The PyArg_Parse functions no longer (noisily)
convert float arguments to integer-taking format characters, so fix the test
to expect the failure.
Modified: python/branches/p3yk/Lib/test/test_getargs2.py
==============================================================================
--- python/branches/p3yk/Lib/test/test_getargs2.py (original)
+++ python/branches/p3yk/Lib/test/test_getargs2.py Sat Apr 15 11:15:11 2006
@@ -67,7 +67,7 @@
def test_b(self):
from _testcapi import getargs_b
# b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)
- self.failUnlessEqual(3, getargs_b(3.14))
+ self.assertRaises(TypeError, getargs_b, 3.14)
self.failUnlessEqual(99, getargs_b(Long()))
self.failUnlessEqual(99, getargs_b(Int()))
@@ -83,7 +83,7 @@
def test_B(self):
from _testcapi import getargs_B
# B returns 'unsigned char', no range checking
- self.failUnlessEqual(3, getargs_B(3.14))
+ self.assertRaises(TypeError, getargs_B, 3.14)
self.failUnlessEqual(99, getargs_B(Long()))
self.failUnlessEqual(99, getargs_B(Int()))
@@ -100,7 +100,7 @@
def test_H(self):
from _testcapi import getargs_H
# H returns 'unsigned short', no range checking
- self.failUnlessEqual(3, getargs_H(3.14))
+ self.assertRaises(TypeError, getargs_H, 3.14)
self.failUnlessEqual(99, getargs_H(Long()))
self.failUnlessEqual(99, getargs_H(Int()))
@@ -117,7 +117,7 @@
def test_I(self):
from _testcapi import getargs_I
# I returns 'unsigned int', no range checking
- self.failUnlessEqual(3, getargs_I(3.14))
+ self.assertRaises(TypeError, getargs_I, 3.14)
self.failUnlessEqual(99, getargs_I(Long()))
self.failUnlessEqual(99, getargs_I(Int()))
@@ -153,7 +153,7 @@
def test_i(self):
from _testcapi import getargs_i
# i returns 'int', and does range checking (INT_MIN ... INT_MAX)
- self.failUnlessEqual(3, getargs_i(3.14))
+ self.assertRaises(TypeError, getargs_i, 3.14)
self.failUnlessEqual(99, getargs_i(Long()))
self.failUnlessEqual(99, getargs_i(Int()))
@@ -169,7 +169,7 @@
def test_l(self):
from _testcapi import getargs_l
# l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)
- self.failUnlessEqual(3, getargs_l(3.14))
+ self.assertRaises(TypeError, getargs_l, 3.14)
self.failUnlessEqual(99, getargs_l(Long()))
self.failUnlessEqual(99, getargs_l(Int()))
More information about the Python-3000-checkins
mailing list