Yet another note to self.

You're working on some unit tests in pytest and its default log/print capturing is getting a bit in the way. You want to see print or logging calls immediately when they happen and not in some captured/delayed fashion.

Add these command line options:

pytest --capture=no --log-cli-level=INFO

Short explanation:

  • --capture=no (or shortcut -s) disables capturing of print calls
  • --log-cli-level enables "live logs": logging records are shown immediately as they happen

For in-depth information and more related options see pytest's docs on output capturing and logging.