Skip to content

Commit a4b73dd

Browse files
committed
gh-124040: simplify two hypot tests
One-argument form is enough to test L2636 and compare computed values exactly.
1 parent e5b0185 commit a4b73dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_math.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,8 @@ def testHypot(self):
809809
# Test allowable types (those with __float__)
810810
self.assertEqual(hypot(12.0, 5.0), 13.0)
811811
self.assertEqual(hypot(12, 5), 13)
812-
self.assertEqual(hypot(1, -1), math.sqrt(2))
813-
self.assertEqual(hypot(1, FloatLike(-1.)), math.sqrt(2))
812+
self.assertEqual(hypot(-1), 1.0)
813+
self.assertEqual(hypot(FloatLike(-1.)), 1.0)
814814
self.assertEqual(hypot(Decimal(12), Decimal(5)), 13)
815815
self.assertEqual(hypot(Fraction(12, 32), Fraction(5, 32)), Fraction(13, 32))
816816
self.assertEqual(hypot(bool(1), bool(0), bool(1), bool(1)), math.sqrt(3))

0 commit comments

Comments
 (0)