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.
Bu egzersiz
Introduction to Testing in Python
kursunun bir parçasıdırUygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
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(____) ____ ____