Setting up Capture Points Tests¶
CodeGrade has a Help Center, with better guides, more videos and updated documentation. The documentation and guides on this website are deprecated and will not be updated in the future. Please click here to go to this page on the Help Center!
With a Capture Points test you can easily run and integrate your own unit test scripts. A Capture Points Test captures the output of the executed program with a Python3 Regular Expression. This output should be a number between 0 and 1.
Press the “ Capture Points” button to add a new Capture Points test to your Test Category.
Input which program you want to execute.
Specify the Python3 Regex with which you want to capture the output. By default this captures a single float. This number is multiplied by the weight to get the amount of points.
A Python3 Regex may contain
\f, which will capture a float.
We recommend you run your program with our utility program
normalize_floats to ensure that the score you write can be read
correctly by CodeGrade. For example, if the command to run your tests is
run_tests, you would run
normalize_floats 2 run_tests to output the
score with 2 decimals precision.