Test & Code

By: Brian Okken
  • Summary

  • The Python Testing Podcast hosted by Brian Okken
    © 2024 Brian Okken
    Show more Show less
Episodes
  • pytest-md and pytest-md-report: Markdown reports for pytest
    Mar 1 2025

    Markdown reports as either text or markdown tables.
    Two fun plugins discussed.

    Links:

    • pytest-md-report
    • pytest-md
    • Top pytest Plugins

    Learn pytest

    • pytest is the number one test framework for Python.
    • Learn the basics super fast with Hello, pytest!
    • Then later you can become a pytest expert with The Complete pytest Course
    • Both courses are at courses.pythontest.com
    ★ Support this podcast on Patreon ★
    Show more Show less
    10 mins
  • Mocking in Python with unittest.mock - Michael Foord
    Feb 7 2025

    This episode is a replay of a 2021 interview I did with Michael Foord.
    We lost Michael in January, and I'd like to revisit this interview as a tribute.

    Michael Foord was a pivotal figure in the Python community and the creator of the mock library that's now unittest.mock.
    But he did so much more as well.
    His contributions continue to resonate within the developer community.
    This interview is just a small peek at his influence.

    In this episode

    • Introduction to Michael Foord
    • The Mock Library Origins
    • Mocking and Testing Philosophy
    • Career Path and Consulting
    • Understanding Mocking
    • The Power of Patch
    • Testing Strategies and Design
    • Mocking External Dependencies
    • Teaching Testing and Mocking

    python.org has put up an "In memoriam" page for Michael Foord, and many people have shared stories and memories.

    Links:

    • In memoriam: Michael Foord 1974-2025
    • 30 best practices for software development and testing


    ★ Support this podcast on Patreon ★
    Show more Show less
    48 mins
  • pytest-mock : Mocking in pytest
    Jan 31 2025

    pytest-mock is currently the #3 pytest plugin.
    pytest-mock is a wrapper around unittest.mock.

    In this episode:

    • Why the pytest-mock plugin is awesome
    • What is mocking, patching, and monkey patching
    • What, if any, is the difference between mock, fake, spy, stub.
    • Why we might need these in testing
    • Some history of mock in Python and how mock became unittest.mock
    • From unittest.mock
      • patch.object
      • patch.object with autospec
      • using these as context managers
    • pytest-mock:
      • The mocker fixture
      • Cleanup in teardown
      • Using mocker.patch, mocker.spy, and mocker.stub
      • Why it's awesome and why you might want to use it over straight unittest.mock

    Links:

    • top pytest plugins list
    • pytest-mock documentation
    • unittest.mock
    • Podcast episode discussing unittest.mock with Michael Foord
    • monkeypatch

    Learn pytest

    • pytest is the number one test framework for Python.
    • Learn the basics super fast with Hello, pytest!
    • Then later you can become a pytest expert with The Complete pytest Course
    • Both courses are at courses.pythontest.com
    ★ Support this podcast on Patreon ★
    Show more Show less
    11 mins

What listeners say about Test & Code

Average customer ratings

Reviews - Please select the tabs below to change the source of reviews.