diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-12-05 20:28:34 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-12-05 20:28:34 (GMT) |
commit | 5c2db37c20ad62097ffaaea32c7e332484c200e0 (patch) | |
tree | 9f88385ce641ffaa2587693bd38bc1d0f2cfb674 /Lib/test/test_getargs2.py | |
parent | c39aad7c278135e599489914e74cf939e39953e9 (diff) | |
download | cpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.zip cpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.tar.gz cpython-5c2db37c20ad62097ffaaea32c7e332484c200e0.tar.bz2 |
Issue #7435: Remove duplicate int/long tests, and other
references to long in py3k. Patch provided by flox.
Diffstat (limited to 'Lib/test/test_getargs2.py')
-rw-r--r-- | Lib/test/test_getargs2.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 3ffc1cc..ee01018 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -55,10 +55,6 @@ LLONG_MAX = 2**63-1 LLONG_MIN = -2**63 ULLONG_MAX = 2**64-1 -class Long: - def __int__(self): - return 99 - class Int: def __int__(self): return 99 @@ -68,7 +64,6 @@ class Unsigned_TestCase(unittest.TestCase): from _testcapi import getargs_b # b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX) self.assertRaises(TypeError, getargs_b, 3.14) - self.assertEqual(99, getargs_b(Long())) self.assertEqual(99, getargs_b(Int())) self.assertRaises(OverflowError, getargs_b, -1) @@ -77,31 +72,26 @@ class Unsigned_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1) self.assertEqual(42, getargs_b(42)) - self.assertEqual(42, getargs_b(42)) self.assertRaises(OverflowError, getargs_b, VERY_LARGE) def test_B(self): from _testcapi import getargs_B # B returns 'unsigned char', no range checking self.assertRaises(TypeError, getargs_B, 3.14) - self.assertEqual(99, getargs_B(Long())) self.assertEqual(99, getargs_B(Int())) self.assertEqual(UCHAR_MAX, getargs_B(-1)) - self.assertEqual(UCHAR_MAX, getargs_B(-1)) self.assertEqual(0, getargs_B(0)) self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX)) self.assertEqual(0, getargs_B(UCHAR_MAX+1)) self.assertEqual(42, getargs_B(42)) - self.assertEqual(42, getargs_B(42)) self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE)) def test_H(self): from _testcapi import getargs_H # H returns 'unsigned short', no range checking self.assertRaises(TypeError, getargs_H, 3.14) - self.assertEqual(99, getargs_H(Long())) self.assertEqual(99, getargs_H(Int())) self.assertEqual(USHRT_MAX, getargs_H(-1)) @@ -110,7 +100,6 @@ class Unsigned_TestCase(unittest.TestCase): self.assertEqual(0, getargs_H(USHRT_MAX+1)) self.assertEqual(42, getargs_H(42)) - self.assertEqual(42, getargs_H(42)) self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE)) @@ -118,7 +107,6 @@ class Unsigned_TestCase(unittest.TestCase): from _testcapi import getargs_I # I returns 'unsigned int', no range checking self.assertRaises(TypeError, getargs_I, 3.14) - self.assertEqual(99, getargs_I(Long())) self.assertEqual(99, getargs_I(Int())) self.assertEqual(UINT_MAX, getargs_I(-1)) @@ -127,7 +115,6 @@ class Unsigned_TestCase(unittest.TestCase): self.assertEqual(0, getargs_I(UINT_MAX+1)) self.assertEqual(42, getargs_I(42)) - self.assertEqual(42, getargs_I(42)) self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE)) @@ -136,7 +123,6 @@ class Unsigned_TestCase(unittest.TestCase): # k returns 'unsigned long', no range checking # it does not accept float, or instances with __int__ self.assertRaises(TypeError, getargs_k, 3.14) - self.assertRaises(TypeError, getargs_k, Long()) self.assertRaises(TypeError, getargs_k, Int()) self.assertEqual(ULONG_MAX, getargs_k(-1)) @@ -145,7 +131,6 @@ class Unsigned_TestCase(unittest.TestCase): self.assertEqual(0, getargs_k(ULONG_MAX+1)) self.assertEqual(42, getargs_k(42)) - self.assertEqual(42, getargs_k(42)) self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE)) @@ -154,7 +139,6 @@ class Signed_TestCase(unittest.TestCase): from _testcapi import getargs_i # i returns 'int', and does range checking (INT_MIN ... INT_MAX) self.assertRaises(TypeError, getargs_i, 3.14) - self.assertEqual(99, getargs_i(Long())) self.assertEqual(99, getargs_i(Int())) self.assertRaises(OverflowError, getargs_i, INT_MIN-1) @@ -163,14 +147,12 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_i, INT_MAX+1) self.assertEqual(42, getargs_i(42)) - self.assertEqual(42, getargs_i(42)) self.assertRaises(OverflowError, getargs_i, VERY_LARGE) def test_l(self): from _testcapi import getargs_l # l returns 'long', and does range checking (LONG_MIN ... LONG_MAX) self.assertRaises(TypeError, getargs_l, 3.14) - self.assertEqual(99, getargs_l(Long())) self.assertEqual(99, getargs_l(Int())) self.assertRaises(OverflowError, getargs_l, LONG_MIN-1) @@ -179,7 +161,6 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_l, LONG_MAX+1) self.assertEqual(42, getargs_l(42)) - self.assertEqual(42, getargs_l(42)) self.assertRaises(OverflowError, getargs_l, VERY_LARGE) def test_n(self): @@ -187,7 +168,6 @@ 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.assertRaises(TypeError, getargs_n, Long()) self.assertRaises(TypeError, getargs_n, Int()) self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1) @@ -196,7 +176,6 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1) self.assertEqual(42, getargs_n(42)) - self.assertEqual(42, getargs_n(42)) self.assertRaises(OverflowError, getargs_n, VERY_LARGE) @@ -206,7 +185,6 @@ class LongLong_TestCase(unittest.TestCase): # L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX) self.assertRaises(TypeError, getargs_L, "Hello") self.assertEqual(3, getargs_L(3.14)) - self.assertEqual(99, getargs_L(Long())) self.assertEqual(99, getargs_L(Int())) self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1) @@ -215,21 +193,18 @@ class LongLong_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1) self.assertEqual(42, getargs_L(42)) - self.assertEqual(42, getargs_L(42)) self.assertRaises(OverflowError, getargs_L, VERY_LARGE) def test_K(self): from _testcapi import getargs_K # K return 'unsigned long long', no range checking self.assertRaises(TypeError, getargs_K, 3.14) - self.assertRaises(TypeError, getargs_K, Long()) self.assertRaises(TypeError, getargs_K, Int()) self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX)) self.assertEqual(0, getargs_K(0)) self.assertEqual(0, getargs_K(ULLONG_MAX+1)) self.assertEqual(42, getargs_K(42)) - self.assertEqual(42, getargs_K(42)) self.assertEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) |