Debugging robot framework python keyword libraries

前端 未结 3 1689
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 09:28

For learning purposes I want to follow the execution path in a robot framework python library. Actually the ssh library

What is the best way to do this?

I have

3条回答
  •  深忆病人
    2021-02-01 10:01

    As I prefer to use ipdb more than pdb, then here is my way to use it with robot

    import ipdb; ipdb.stdout.update_stdout(); ipdb.stdout.set_trace()
    

    Hint: For some reason the autocomplete wont be working using pdb nor ipdb so if u care about the autocomplete u need to install pdbpp via pip install pdbpp then add this to your code

    import sys
    import pdb
    for attr in ('stdin', 'stdout', 'stderr'):
        setattr(sys, attr, getattr(sys, '__%s__' % attr))
    pdb.set_trace()
    

提交回复
热议问题