Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48952d3

Browse files
committed
Forgot to run the tests after making the places and msg argument keyword-only.
This fixes the tests that broke.
1 parent 3404b3c commit 48952d3

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

Lib/ctypes/test/test_byteswap.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ def test_endian_float(self):
114114
s = c_float(math.pi)
115115
self.failUnlessEqual(bin(struct.pack("f", math.pi)), bin(s))
116116
# Hm, what's the precision of a float compared to a double?
117-
self.failUnlessAlmostEqual(s.value, math.pi, 6)
117+
self.failUnlessAlmostEqual(s.value, math.pi, places=6)
118118
s = c_float.__ctype_le__(math.pi)
119-
self.failUnlessAlmostEqual(s.value, math.pi, 6)
119+
self.failUnlessAlmostEqual(s.value, math.pi, places=6)
120120
self.failUnlessEqual(bin(struct.pack("<f", math.pi)), bin(s))
121121
s = c_float.__ctype_be__(math.pi)
122-
self.failUnlessAlmostEqual(s.value, math.pi, 6)
122+
self.failUnlessAlmostEqual(s.value, math.pi, places=6)
123123
self.failUnlessEqual(bin(struct.pack(">f", math.pi)), bin(s))
124124

125125
def test_endian_double(self):

Lib/test/test_cmath.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def cAssertAlmostEqual(self, a, b, rel_eps = 1e-10, abs_eps = 1e-100):
2727
def test_constants(self):
2828
e_expected = 2.71828182845904523536
2929
pi_expected = 3.14159265358979323846
30-
self.assertAlmostEqual(cmath.pi, pi_expected, 9,
31-
"cmath.pi is %s; should be %s" % (cmath.pi, pi_expected))
32-
self.assertAlmostEqual(cmath.e, e_expected, 9,
33-
"cmath.e is %s; should be %s" % (cmath.e, e_expected))
30+
self.assertAlmostEqual(cmath.pi, pi_expected, places=9,
31+
msg="cmath.pi is %s; should be %s" % (cmath.pi, pi_expected))
32+
self.assertAlmostEqual(cmath.e, e_expected, places=9,
33+
msg="cmath.e is %s; should be %s" % (cmath.e, e_expected))
3434

3535
def test_user_object(self):
3636
# Test automatic calling of __complex__ and __float__ by cmath

Lib/test/test_random.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ def test_avg_std(self):
505505
s1 += e
506506
s2 += (e - mu) ** 2
507507
N = len(y)
508-
self.assertAlmostEqual(s1/N, mu, 2)
509-
self.assertAlmostEqual(s2/(N-1), sigmasqrd, 2)
508+
self.assertAlmostEqual(s1/N, mu, places=2)
509+
self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2)
510510

511511
class TestModule(unittest.TestCase):
512512
def testMagicConstants(self):

0 commit comments

Comments
 (0)