scūriolus
scūriolus

Reputation: 968

iPython features in pytest debugging sessions

I'm struggling with pytest configuration. I would like to:

  1. use breakpoint() wherever I want in my tests to start debugging sessions,
  2. in that case, be able to enter multi line inputs (several lines of code in a row that should be run simultaneously),
  3. have colors both for Pytest output (PASSED in green, for instance) and for the loosely coupled debugging code I'm writing (what follows >ipdb in the screenshot below),
  4. have a clean and readable indentation in my breakpoint() inputs,
  5. have tab completion like in iPython,
  6. have the same environment in the debugging sessions started on failure with the --pdb flag.

(from highest to lowest priority)

In short, I'd like to improve that:

enter image description here

Here is the context: I'm doing TDD and I'd like to have the most comfortable working environment.

For now, I've set PYTHONBREAKPOINT to "IPython.terminal.debugger.set_trace" (doc) and I run pytest with --pdbcls=IPython.terminal.debugger:Pdb (cf. this other question).

I haven't given bpython a try, should I consider this alternative?

Upvotes: 2

Views: 65

Answers (0)

Related Questions