Issue #18659: Backed out changeset cfd875bcbe41 after buildbot failures.

This commit is contained in:
Mark Dickinson 2013-08-05 10:59:36 +01:00
parent a9e626f704
commit f3e4b62d02
1 changed files with 7 additions and 3 deletions

View File

@ -327,6 +327,10 @@ class FormatTest(unittest.TestCase):
self.assertIs(text % (), text)
self.assertIs(text.format(), text)
def test_main():
support.run_unittest(FormatTest)
def test_precision(self):
INT_MAX = 2147483647
@ -338,10 +342,10 @@ class FormatTest(unittest.TestCase):
self.assertEqual(str(cm.exception), "precision too big")
c = complex(f)
self.assertEqual(format(c, ".0f"), "1+0j")
self.assertEqual(format(c, ".3f"), "1.200+0.000j")
self.assertEqual(format(f, ".0f"), "1")
self.assertEqual(format(f, ".3f"), "1.200")
with self.assertRaises(ValueError) as cm:
format(c, ".%sf" % (INT_MAX + 1))
format(f, ".%sf" % (INT_MAX + 1))
self.assertEqual(str(cm.exception), "precision too big")