简体   繁体   中英

Robot Framework debug python code using PUDB

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.

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()
    ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM