Getting Started#
The grading lib provides common components for a grading scripts. For example, you can create a simple grading script by
# file: scripts/grade.py
import unittest
from grading_lib.common import BaseTestCase, MinimalistTestResult
class TestExampleProblem:
def test_example_problem(self):
self.assertEqual(1, 1)
if __name__ == "__main__":
runner = unittest.TextTestRunner(resultclass=MinimalistTestResult)
unittest.main(testRunner=runner)
Build System Problems#
The grading lib offers powerful utilities for authoring a grading script for a build system related problem. Here are some notable example of such utilities.
makefile.run_targetsthat runs a target (or targets) in aMakefileand return theCommandResult.A class
makefile.Makefilethat offer high-level parsing for aMakefile.
Git Problems#
Similarly, grading lib has these utilities that will help you write a problem for Git.
Useful CLI Commands#
grading-lib provides command-line interface (CLI) with some useful commands.
A
summarycommand that shows the number of problems, total points and points per problem.A
dev mypycommand that runs Mypy against the grading scripts in thescripts/folder.