Something like:
def partial_credit(score, output="Partial credit.\n") -> None:
"""Give partial credit for passing some of the asserts.
Sets the `score` and `output` attributes of the test function.
"""
test_func = get_caller()
test_func.score = score
test_func.output = output
Also modify the half_credit() function to use an output parameter with default value.
Something like:
Also modify the
half_credit()function to use an output parameter with default value.