Forrest logo
back to the pytest tool

pytest:tldr:18482

pytest: Run until a test failure, continuing from the last failing test.
$ pytest --stepwise
try on your machine

The command "pytest --stepwise" is used to run pytest test cases in a stepwise manner.

When running test cases using pytest, all test cases are executed by default. However, in some scenarios, it might be useful to stop execution after each test case, allowing you to interactively inspect the progress of the tests.

The "--stepwise" option enables this behavior. When this option is used, pytest will pause execution after each test case, allowing you to decide whether to continue or stop the test run.

After the completion of each test case, pytest will display a prompt that gives you the following options:

  • "s" or "n" to skip the current test case and move to the next one
  • "q" to quit the entire test run immediately
  • "r" to resume test execution and continue running the remaining test cases

This stepwise execution method allows you to inspect the results and debug any issues after each test case, providing better control and workflow during test execution.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pytest tool