check50 icon indicating copy to clipboard operation
check50 copied to clipboard

unexpected failure type for check50.run("X")..stdout("lala") if X returns empty string

Open pazz opened this issue 3 years ago • 1 comments

I have a check that calls run and stdout like this:

def mas_check_stuff():
    check50_java.run("some command").stdout("expected)

and check50 produces a json report like this:

        {
            "name": "mas_check_stuff",
            "description": "bla",
            "passed": false,
            "log": [
                "running some command",
            ],
            "cause": {
                "rationale": "Did not find \"expected\"",
                "help": null,
                "missing_item": "expected",
                "collection": ""
            },
            "data": {},

        },

Here, the student's submission actually produced the empty string. It looks like check50.run().stdout() produces a check50.Missing exception. But that is not documented like this! I am expecting a Mismatch for further processing..

https://cs50.readthedocs.io/projects/check50/en/latest/api/#check50.run.stdout

pazz avatar Apr 24 '21 12:04 pazz

Sorry: the command X does not produce the empty string but it does not terminate. Still, this should raise something that is documented. Thanks!

pazz avatar Apr 24 '21 12:04 pazz