From 3a13a7bfda1479889bb8a13d6f4ea305c5c6fa48 Mon Sep 17 00:00:00 2001 From: Yongjin Date: Sat, 25 Mar 2023 15:21:41 +0900 Subject: [PATCH] update test_math.py from cpython 3.11.2 --- Lib/test/test_math.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index 0067e1c06b..2f64180652 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -1006,6 +1006,11 @@ class T(tuple): 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 = (