Setting up Capture Points Tests¶
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.