Get startedGet started for free

The first test suite

In this exercise, you will write the first test suite that includes the types of tests that you have learned using the pytest library.

The function multiple_of_two checks whether the num is a multiple of 2 or not. You will implement and run two regular assert tests.

The pytest package has already been imported.

This exercise is part of the course

Introduction to Testing in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

def multiple_of_two(num):
    if num == 0:
        raise(ValueError)
    return num % 2 == 0

def test_numbers():
    # Write the "True" test below
    ____ multiple_of_two(____) ____ ____
Edit and Run Code