rileyshahar / aga

aga grades assignments
MIT License
8 stars 2 forks source link

show hidden cases when using aga run #61

Closed FlickerSoul closed 1 year ago

FlickerSoul commented 1 year ago
# problem script 
def override(the_case, golden, student):
    if the_case.args[0] == 2:
        the_case.name = "2 is special"
    the_case.description = f"Override for {the_case.args}"
    the_case.assertTrue(golden(*the_case.args) == student(*the_case.args))

@test_case(3, aga_description="some random description")
@test_case(2, aga_override_test=override)
@test_case(1, aga_hidden=True, aga_override_test=override)
@problem()
def t(x) -> int:
    return x

# test script 
def t(x) -> int:
    if x == 3:
        return 0

    return x

The code will generate the following output.

image