Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 669 Bytes

ipdb.md

File metadata and controls

37 lines (24 loc) · 669 Bytes

ipdb

Today I learnt ...

... how to use the Python debugger with the ipython niceties

2023-01-10T06:39:34+00:00

Set an environment variable in your shell so that using python's breakpoint() uses ipdb instead of the vanilla pdb

Recipe

  1. Set env var

    echo 'export PYTHONBREAKPOINT="ipdb.set_trace"' >> ~/.zshrc;
    source ~/.zshrc
  2. Add the breakpoint in your test

    def test_mocked_get_access_token():
    +    breakpoint()
        assert True
      
  3. Run it

    pytest -s tests/
  4. ipdb paused execution