aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_builtin.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_builtin.py')
-rw-r--r--Lib/test/test_builtin.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index f1f877c47a1..14fe3355239 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -393,7 +393,7 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
self.assertRaises(ValueError, chr, -2**1000)
def test_cmp(self):
- self.assertTrue(not hasattr(builtins, "cmp"))
+ self.assertNotHasAttr(builtins, "cmp")
def test_compile(self):
compile('print(1)\n', '', 'exec')
@@ -2304,7 +2304,7 @@ class BuiltinTest(ComplexesAreIdenticalMixin, unittest.TestCase):
# tests for object.__format__ really belong elsewhere, but
# there's no good place to put them
x = object().__format__('')
- self.assertTrue(x.startswith('<object object at'))
+ self.assertStartsWith(x, '<object object at')
# first argument to object.__format__ must be string
self.assertRaises(TypeError, object().__format__, 3)
@@ -2991,7 +2991,8 @@ class TestType(unittest.TestCase):
def load_tests(loader, tests, pattern):
from doctest import DocTestSuite
- tests.addTest(DocTestSuite(builtins))
+ if sys.float_repr_style == 'short':
+ tests.addTest(DocTestSuite(builtins))
return tests
if __name__ == "__main__":