Talk Python to Me is a weekly podcast hosted by developer and entrepreneur Michael Kennedy. We dive deep into the popular packages and software developers, data scientists, and incredible hobbyists doing amazing things with Python. If you're new to Python, you'll quickly learn the ins and outs of the community by hearing from the leaders. And if you've been Pythoning for years, you'll learn about your favorite packages and the hot new ones coming out of open source.
…
continue reading
Content provided by Brian Okken. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Brian Okken or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!
Go offline with the Player FM app!
pytest-mock : Mocking in pytest
MP3•Episode home
Manage episode 464257969 series 2508404
Content provided by Brian Okken. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Brian Okken or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
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
Sponsored by:
- The Complete pytest course is now a bundle, with each part available separately.
- pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively.
- Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI
- Then pytest Booster Rockets can help with advanced parametrization and building plugins.
- Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.
232 episodes
MP3•Episode home
Manage episode 464257969 series 2508404
Content provided by Brian Okken. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Brian Okken or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
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
Sponsored by:
- The Complete pytest course is now a bundle, with each part available separately.
- pytest Primary Power teaches the super powers of pytest that you need to learn to use pytest effectively.
- Using pytest with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CI
- Then pytest Booster Rockets can help with advanced parametrization and building plugins.
- Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you.
232 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.