Robot Framework debug python code using PUDB

1.4k views Asked by At

I'm trying to debug python code executed from Robot. As was mentioned here by Bryan Oakley, there is possibility to debug it using:
import sys, pdb; pdb.Pdb(stdout=sys.__stdout__).set_trace()
This is a good solution and it helps a lot. Also there is a great debugger with text based graphic which is even more useful and easier to use that's called PUDB. I tried to make PUDB work in a similar way as Bryan mentioned in his answer, but I didn't succeed.
If someone managed to make it work, please share your solution.
Thank you.

1

There are 1 answers

0
Bryan Oakley On BEST ANSWER

The equivalent for pudb appears to be to instantiate Debugger from pudb.debugger. For example:

import pudb.debugger
import sys

def example_keyword():
    ...
    pudb.debugger.Debugger(stdout=sys.__stdout__).set_trace()
    ...