Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirwaleed committed Jan 8, 2025
1 parent 02bd25a commit 5e5c079
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions solutions/max_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ def max_integer(my_list: list) -> int:
None
"""
assert isinstance(my_list, list), "input must be a list"
for i in my_list:
assert isinstance(i, float or int), "elements must be numbers"

if len(my_list) == 0:
return None
Expand Down
6 changes: 2 additions & 4 deletions solutions/tests/test_max_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ def test_ints_and_floats(self):
def test_string(self):
"""Test a string."""
string = "Brennan"
with self.assertRaises(AssertionError):
max_integer(string)
self.assertEqual(max_integer(string), "r")

def test_list_of_strings(self):
"""Test a list of strings."""
strings = ["Brennan", "is", "my", "name"]
with self.assertRaises(AssertionError):
max_integer(strings)
self.assertEqual(max_integer(strings), "name")

def test_empty_string(self):
"""Test an empty string."""
Expand Down

0 comments on commit 5e5c079

Please sign in to comment.