Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
update test_math.py from cpython 3.11.2
  • Loading branch information
sapsalian committed Mar 25, 2023
commit 3a13a7bfda1479889bb8a13d6f4ea305c5c6fa48
5 changes: 5 additions & 0 deletions Lib/test/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down