diff options
author | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-22 19:02:40 +0000 |
---|---|---|
committer | Trent Nelson <trent.nelson@snakebite.org> | 2008-04-22 19:02:40 +0000 |
commit | b17ba96d9de56577398d2172804f848747ce0a42 (patch) | |
tree | 7392a2019cf3affebd2e7ca2f5e46bb0804304d7 /Lib/test/test_getargs2.py | |
parent | f881c53a45f30ac98fa745705d8ce6ee65b9a513 (diff) | |
download | cpython-b17ba96d9de56577398d2172804f848747ce0a42.tar.gz |
Issue 2440: remove the guard around the handling of case 'n' in getargs.c's convertsimple() such that we always treat it as an index type, regardless of whether or not sizeof(size_t) == sizeof(long). Fix the test_args2.Signed_TestCase.test_n() such that it tests for adherence to PEP 357 (don't try and coerce objects that don't have nb_index slots but do have nb_int slots (i.e. floats) into indexes 'just because we can'). Three other commits are related to this one: r62269 and r62279, which were changes to PyNumber_Index (among other things) to check for nb_int slots when we lack nb_index slots -- and r62292, which is when I reverted these changes after various people pointed out that the test was in fact wrong, not the code.
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r-- | Lib/test/test_getargs2.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 19183867f9..69791e8d7d 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -187,8 +187,8 @@ class Signed_TestCase(unittest.TestCase): # n returns 'Py_ssize_t', and does range checking # (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX) self.assertRaises(TypeError, getargs_n, 3.14) - self.failUnlessEqual(99, getargs_n(Long())) - self.failUnlessEqual(99, getargs_n(Int())) + self.assertRaises(TypeError, getargs_n, Long()) + self.assertRaises(TypeError, getargs_n, Int()) self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1) self.failUnlessEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN)) |