mirror of https://github.com/python/cpython
Make this test work under Windows as well.
This commit is contained in:
parent
99e87f9e23
commit
f973c6d594
|
@ -32,8 +32,11 @@ class FpformatTest(unittest.TestCase):
|
||||||
if isinstance(n, StringType):
|
if isinstance(n, StringType):
|
||||||
n = repr(n)
|
n = repr(n)
|
||||||
expected = "%.*e" % (digits, float(n))
|
expected = "%.*e" % (digits, float(n))
|
||||||
# add the extra 0
|
# add the extra 0 if needed
|
||||||
expected = expected[:-2]+'0'+expected[-2:]
|
num, exp = expected.split("e")
|
||||||
|
if len(exp) < 4:
|
||||||
|
exp = exp[0] + "0" + exp[1:]
|
||||||
|
expected = "%se%s" % (num, exp)
|
||||||
|
|
||||||
self.assertEquals(result, expected)
|
self.assertEquals(result, expected)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue