Skip to content

Adding tests for multi-step exercises

For multi-step exercises, you need to specify directly in the exercise file which test applies to each step. The format for specifying the test for each instruction is as follows:

Step 1

:::tests

{test_to_check_step1_solution}.py

:::tests

The :::tests sections are not displayed to learners. They are used to indicate, which test to use to check that the step solution is correct.

A fragment of the thermometer sample exercise illustrates how to specify the test file that checks the instruction condition is met.

[Copy Code](javascript:void(0)) Python
## Instructions ### 1 Let's make our `thermometer()` function do something. Instead of `pass`, add an `if` condition that returns "Too hot" if temperature is 30 degrees or higher. :::tests thermometer_tests_1.py :::