summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_int.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2012-12-27 22:16:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2012-12-27 22:16:53 (GMT)
commit1ef73d21a209ab48248db4fa75db523e803a9f19 (patch)
treeda0a24ab4f08810be56a9729f41e3e201ca80e33 /Lib/test/test_int.py
parent8a158be94e074d284c5371b957956af0e974443a (diff)
parent3b3170447f9f578891945ba97be5c7662fec5ffc (diff)
downloadcpython-1ef73d21a209ab48248db4fa75db523e803a9f19.zip
cpython-1ef73d21a209ab48248db4fa75db523e803a9f19.tar.gz
cpython-1ef73d21a209ab48248db4fa75db523e803a9f19.tar.bz2
Issue #16792: Mark small ints test as CPython-only.
Diffstat (limited to 'Lib/test/test_int.py')
-rw-r--r--Lib/test/test_int.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index e0406dd..225b520 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -100,10 +100,6 @@ class IntTestCases(unittest.TestCase):
self.assertRaises(ValueError, int, "0b", 2)
self.assertRaises(ValueError, int, "0b", 0)
- # Bug #3236: Return small longs from PyLong_FromString
- self.assertTrue(int("10") is 10)
- self.assertTrue(int("-1") is -1)
-
# SF bug 1334662: int(string, base) wrong answers
# Various representations of 2**32 evaluated to 0
# rather than 2**32 in previous versions
@@ -221,6 +217,14 @@ class IntTestCases(unittest.TestCase):
self.assertEqual(int('2br45qc', 35), 4294967297)
self.assertEqual(int('1z141z5', 36), 4294967297)
+ @support.cpython_only
+ def test_small_ints(self):
+ # Bug #3236: Return small longs from PyLong_FromString
+ self.assertIs(int('10'), 10)
+ self.assertIs(int('-1'), -1)
+ self.assertIs(int(b'10'), 10)
+ self.assertIs(int(b'-1'), -1)
+
def test_no_args(self):
self.assertEquals(int(), 0)