update test_math.py from cpython 3.11.2

This commit is contained in:
Yongjin
2023-03-25 15:21:41 +09:00
parent 415cdb1ef9
commit 3a13a7bfda

View File

@@ -1006,6 +1006,11 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.dist(p, q), 5*scale)
self.assertEqual(math.dist(q, p), 5*scale)
def test_math_dist_leak(self):
# gh-98897: Check for error handling does not leak memory
with self.assertRaises(ValueError):
math.dist([1, 2], [3, 4, 5])
def testIsqrt(self):
# Test a variety of inputs, large and small.
test_values = (