-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
refactorTasks to improve readability / performanceTasks to improve readability / performance
Description
Some functions raises errors like ValueError and TypeError.
Although they are important to be included in tests, most of the raisers are only verification of the functions' inputs. Example:
def binom(n: int, i: int) -> int:
"""Computes the binom (n, i)"""
if not isinstance(n, int) or not isinstance(i, int):
raise ValueError("n and i must be integers")
return factorial(n) // (factorial(n-i) * factorial(i))
def factorial(n: int) -> int:
"""Computes the factorial of n"""
if not isinstance(n, int) or n < 0:
raise ValueError("n must be integer >= 0")
return math.factorial(n)The intention is to ignore these cases in the coverage.
Metadata
Metadata
Assignees
Labels
refactorTasks to improve readability / performanceTasks to improve readability / performance