
Sign up to save your podcasts
Or


Do you have complex logic and unpredictable dependencies that make it hard to write reliable tests? How can you use Python’s mock object library to improve your tests? Christopher Trudeau is back on the show this week with another batch of PyCoder’s Weekly articles and projects.
Christopher shares details about his recent Real Python video course, “Improving Your Tests With the Python Mock Object Library.” He describes how mocking in Python with unittest.mock allows you to simulate complex logic or unpredictable dependencies, such as responses from external services. He covers how the Mock class can imitate real objects, and the patch() function lets you temporarily substitute mocks for real objects in your tests.
We also share other articles and projects from the Python community, including a collection of recent releases, using open source AI at Wagtail, updates from the inaugural PyPI Support Specialist, a lightweight OS for microcontrollers in MicroPythonOS, why match-case is not necessarily switch-case for Python, thinking about time in programming, a TUI-based presentation tool for the terminal, and a tool to check Django projects for dead code.
This episode is sponsored by AgentField.
Course Spotlight: Improving Your Tests With the Python Mock Object Library
Master Python testing with unittest.mock. Create mock objects to tame complex logic and unpredictable dependencies.
Topics:
News:
Show Links:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Support the podcast & join our community of Pythonistas
By Real Python4.7
139139 ratings
Do you have complex logic and unpredictable dependencies that make it hard to write reliable tests? How can you use Python’s mock object library to improve your tests? Christopher Trudeau is back on the show this week with another batch of PyCoder’s Weekly articles and projects.
Christopher shares details about his recent Real Python video course, “Improving Your Tests With the Python Mock Object Library.” He describes how mocking in Python with unittest.mock allows you to simulate complex logic or unpredictable dependencies, such as responses from external services. He covers how the Mock class can imitate real objects, and the patch() function lets you temporarily substitute mocks for real objects in your tests.
We also share other articles and projects from the Python community, including a collection of recent releases, using open source AI at Wagtail, updates from the inaugural PyPI Support Specialist, a lightweight OS for microcontrollers in MicroPythonOS, why match-case is not necessarily switch-case for Python, thinking about time in programming, a TUI-based presentation tool for the terminal, and a tool to check Django projects for dead code.
This episode is sponsored by AgentField.
Course Spotlight: Improving Your Tests With the Python Mock Object Library
Master Python testing with unittest.mock. Create mock objects to tame complex logic and unpredictable dependencies.
Topics:
News:
Show Links:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Support the podcast & join our community of Pythonistas

288 Listeners

629 Listeners

583 Listeners

291 Listeners

304 Listeners

213 Listeners

990 Listeners

8,090 Listeners

971 Listeners

215 Listeners

208 Listeners

75 Listeners

312 Listeners

99 Listeners

74 Listeners