Get startedGet started for free

Unittest options

Flags and keywords can seem strange, but they can make your life easier in many cases. In this exercise, you will run the "Erroneous factorial" test script using the commands with different options and analyze the results. You do not have to fix anything here; only run the commands.

This exercise is part of the course

Introduction to Testing in Python

View Course

Exercise instructions

  • Run the script with the "verbose" flag to see the extended output about the failed tests.
  • Run the script with the "fail fast" flag and notice how many of the tests run.
  • Run the script with the "keyword" option with "err_func_1" and notice what tests run.

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise