Skip to content

Commit 789bb40

Browse files
author
Kareem Zidane
committed
use assertAlmostEqual
1 parent 9e9cb0b commit 789bb40

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_cs50.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import math
21
import sys
32
import unittest
43

@@ -95,7 +94,7 @@ def test_get_float_valid_input(self):
9594
def assert_equal(return_value, expected_value):
9695
with patch("cs50.cs50.get_string", return_value=return_value) as mock_get_string:
9796
f = _get_float("Answer: ")
98-
self.assertTrue(math.isclose(f, expected_value))
97+
self.assertAlmostEqual(f, expected_value)
9998
mock_get_string.assert_called_with("Answer: ")
10099

101100
values = [

0 commit comments

Comments
 (0)