def init(): for test_id in get_test_ids(NOTEBOOK_PATH): check = create_check(test_id) # Register the check with check50 check = check50.check(dependency=exists)(check) # Add the check to global module scope globals()[test_id] = check
def init(): # Keep track of dependencies last_check = exists for test_id in get_test_ids("module 1.ipynb"): check = create_check(test_id) # Register the check with check50 check = check50.check(dependency=last_check)(check) # Keep track of dependencies last_check = check # Add the check to global module scope globals()[test_id] = check
def init(): # Grab the last test id last_test_id = get_test_ids("module 1.ipynb")[-1] # Create a check running all cells up to last test id def check(): check_jupyter = check50.internal.import_file("check_jupyter", "check_jupyter.py") cells = check_jupyter.cells_up_to("module 1.ipynb", last_test_id) check_jupyter.execute(cells) # Name and document the check check.__name__ = last_test_id check.__doc__ = f"All tests pass" # Register the check with check50 check = check50.check(dependency=exists)(check) # Add the check to global module scope globals()[last_test_id] = check
if not match: raise check50.Mismatch("08 07 06\n05 04 03\n02 __ 01\n", result.stdout) stdout = result.stdout[match.end():] expected = re.compile( "(08 07 06)[ ]*(\n)" "(05 04 03)[ ]*(\n)" "(__ 02 01)[ ]*(\n)", re.MULTILINE) if not expected.search(stdout): raise check50.Mismatch("08 07 06\n05 04 03\n__ 02 01\n", stdout) check50.check(init3) def move_left_right(): """3x3 board: move blank left then right.""" result = uva.check50.py.run("fifteen.py", argv=["fifteen.py", "3"], stdin=["1", "1", "-1"]) expected = re.compile( "(08 07 06)[ ]*(\n)" "(05 04 03)[ ]*(\n)" "(02 __ 01)[ ]*(\n)", re.MULTILINE) match = expected.search(result.stdout)