Python Debugging Cheat Sheet/Run unittest in verbose mode

See each test case as it runs.

Section: pytest and unittest Debugging

Run unittest in verbose mode

bash
bash
python -m unittest -v tests.test_service

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing pytest and unittest Debugging
Stop after first failure
Fail fast and debug one issue at a time.
OpenIn sheetbashsame section
Drop into pdb on failure
Open the debugger automatically when a test fails.
OpenIn sheetbashsame section
Disable output capture
See print statements and standard output live.
OpenIn sheetbashsame section
Run one test function
Narrow execution to one failing test quickly.
OpenIn sheetbashsame section
Re-run only last failed tests
Speed up debugging after a failing run.
OpenIn sheetbashsame section
Show local variables in tracebacks
Reveal local state in failing assertions and exceptions.
OpenIn sheetbashsame section