mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
Issue #16792: Mark small ints test as CPython-only.
This commit is contained in:
parent
9eac6b3848
commit
3b3170447f
1 changed files with 9 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
from test import support
|
||||||
from test.support import run_unittest
|
from test.support import run_unittest
|
||||||
|
|
||||||
L = [
|
L = [
|
||||||
|
@ -100,10 +101,6 @@ class IntTestCases(unittest.TestCase):
|
||||||
self.assertRaises(ValueError, int, "0b", 2)
|
self.assertRaises(ValueError, int, "0b", 2)
|
||||||
self.assertRaises(ValueError, int, "0b", 0)
|
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
|
# SF bug 1334662: int(string, base) wrong answers
|
||||||
# Various representations of 2**32 evaluated to 0
|
# Various representations of 2**32 evaluated to 0
|
||||||
# rather than 2**32 in previous versions
|
# rather than 2**32 in previous versions
|
||||||
|
@ -221,6 +218,14 @@ class IntTestCases(unittest.TestCase):
|
||||||
self.assertEqual(int('2br45qc', 35), 4294967297)
|
self.assertEqual(int('2br45qc', 35), 4294967297)
|
||||||
self.assertEqual(int('1z141z5', 36), 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_intconversion(self):
|
def test_intconversion(self):
|
||||||
# Test __int__()
|
# Test __int__()
|
||||||
class ClassicMissingMethods:
|
class ClassicMissingMethods:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue