Skip to content

Add partial_credit function to coverage,py #27

Description

@ChrisMayfield

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions