why pytest.mark.usefixtures? (intermediate) anthony explains

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

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

  • @pmav99
    @pmav99 4 года назад +5

    How about a video on the pytest "shenanigans"? Although I doubt it is going to be such a short one)))

    • @anthonywritescode
      @anthonywritescode  4 года назад +4

      heheh yeah I could probably show how fixtures actually work and how assertion rewriting actually works -- the rest of pytest is mostly non-magical beyond those two things

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

    Is there a case when one should consider loading fixtures by writing a pytest plugin rather using root conftest.py. exp: running tests in multiple folders without one common test-root path (multiple git projects using same fixtures)?

    • @anthonywritescode
      @anthonywritescode  2 года назад

      I really only make "plugins" if I need to share them across projects. or if conftest gets to be like 1k+ lines

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

    Hello Anthony. I've got question related to fixtures and to xunit-style like setup fixtures (setup_class, setup_method, etc).
    @pytest.fixture()
    def dummy_fixture():
    ...
    class TestClass:
    @classmethod
    def setup_class(cls):

    • @anthonywritescode
      @anthonywritescode  2 года назад

      xunit setup / teardown is only provided as a legacy migration mechanism and does not mix with pytest fixturing

  • @MikeDIY
    @MikeDIY 11 месяцев назад

    Awesome, I’ve always hated that. Nice fix.