diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-21 17:03:08 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-21 17:03:08 (GMT) |
commit | 54cd1969eacf27405e2fe265817ee60a8ece93ab (patch) | |
tree | 870ee7eab92b4bbd6496611939b9f022a2f4dba1 /Lib/test | |
parent | d7f3cdd07d7387787c18c0c34a71ee00d77a26c8 (diff) | |
download | cpython-54cd1969eacf27405e2fe265817ee60a8ece93ab.zip cpython-54cd1969eacf27405e2fe265817ee60a8ece93ab.tar.gz cpython-54cd1969eacf27405e2fe265817ee60a8ece93ab.tar.bz2 |
Issue #26984: int() now always returns an instance of exact int.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_int.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py index b66c5d6..8847f4c 100644 --- a/Lib/test/test_int.py +++ b/Lib/test/test_int.py @@ -430,21 +430,24 @@ class IntTestCases(unittest.TestCase): with self.assertWarns(DeprecationWarning): n = int(bad_int) self.assertEqual(n, 1) + self.assertIs(type(n), int) bad_int = BadInt2() with self.assertWarns(DeprecationWarning): n = int(bad_int) self.assertEqual(n, 1) + self.assertIs(type(n), int) bad_int = TruncReturnsBadInt() with self.assertWarns(DeprecationWarning): n = int(bad_int) self.assertEqual(n, 1) + self.assertIs(type(n), int) good_int = TruncReturnsIntSubclass() n = int(good_int) self.assertEqual(n, 1) - self.assertIs(type(n), bool) + self.assertIs(type(n), int) n = IntSubclass(good_int) self.assertEqual(n, 1) self.assertIs(type(n), IntSubclass) |