rileyshahar / aga

aga grades assignments
MIT License
8 stars 2 forks source link

feat: add 0 score failing support #65

Closed FlickerSoul closed 1 year ago

FlickerSoul commented 1 year ago

In the case where a test case contribute 0 score to the total score, the test case cannot fail successfully. This PR resolves this issue. In the following code, the overrided test case will fail.

from aga import problem, test_case

def test_check(tc, golden, actual):
    return tc.assertTrue(False)

@test_case(aga_override_test=test_check, aga_value=0, aga_weight=0)
@test_case(1, 2, aga_expect=3)
@problem()
def example(a, b):
    return a + b