1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Testing in Python

Exercise

Failed tests with xfail

In this exercise, you will use pytest markers for the first time in order to specify the behavior of the test. You have already seen the function multiple_of_two, which checks whether the num is a multiple of 2 or not. The pytest library was already imported for you.

Instructions

100 XP
  • Add the correct pytest marker for a test that is expected to fail.
  • Write any assert test that is expected to fail.