Debugging "pytest" tests with "ipdb" debug mode

Поделиться
HTML-код
  • Опубликовано: 5 ноя 2024

Комментарии • 8

  • @testertech
    @testertech 2 года назад +2

    Looks like some nice feature additions for debugging tests. Thanks.

  • @dmc549
    @dmc549 2 года назад +1

    Holy Tabs!! Thanks for the video

  • @ABCABC-tt3gp
    @ABCABC-tt3gp 2 года назад +2

    Thank you michael, waiting for more tutorial

  • @ulfgj
    @ulfgj Год назад +1

    awesomsauce! but is there a way in debug mode to test out different selectors? like get text from an element on the page or check if perhaps another selector would fit better while the test is paused?

    • @MichaelMintz
      @MichaelMintz  Год назад +1

      In debug mode, all the usual commands work. Eg. Use `self.is_element_visible("SELECTOR")` to find out if a selector is visible, etc. `self.get_text("SELECTOR")` to get text from a selector, and all the other methods.

    • @ulfgj
      @ulfgj Год назад +1

      @@MichaelMintz ah! absolutely fantastic. tnx!

  • @trevmay
    @trevmay 2 года назад +1

    Thank you for the tutorial! When would you use this over breakpoints with an IDE like PyCharm?

    • @MichaelMintz
      @MichaelMintz  2 года назад +1

      That depends when you want the breakpoint to occur. ``--pdb`` for a breakpoint on exception. ``--trace`` for a breakpoint immediately after tests start. ``ipdb.set_trace()`` for a specific location. It can be combined with IDE breakpoints. You have options.