Test & Code cover image

Test & Code

Latest episodes

undefined
Feb 7, 2025 • 48min

Mocking in Python with unittest.mock - Michael Foord

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 episodeIntroduction to Michael FoordThe Mock Library OriginsMocking and Testing PhilosophyCareer Path and ConsultingUnderstanding MockingThe Power of PatchTesting Strategies and DesignMocking External DependenciesTeaching Testing and Mockingpython.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-202530 best practices for software development and testing ★ Support this podcast on Patreon ★
undefined
Jan 31, 2025 • 11min

pytest-mock : Mocking in pytest

Explore the wonders of mocking in Python testing with pytest-mock, a top plugin that simplifies mock management. Discover the intricacies of concepts like patching, spies, and stubs while learning about their importance in testing. Uncover the history behind unittest.mock and how it evolved in Python. The discussion also highlights the unique features of pytest-mock, including its Mocker fixture and the advantages it offers over traditional methods. Get ready to elevate your testing game!
undefined
Jan 23, 2025 • 12min

pytest-cov : The pytest plugin for measuring coverage

pytest-cov is a pytest plugin that helps produce coverage reports using Coverage.py.In this episode, we'll discuss:what Coverage.py iswhy you should measure code coverage on both your source and test codewhat pytest-cov isextra features pytest-cov gives you over and above coverage.pyand generally why using both is awesomeLinks:coverage.pypytest-covhow to set up context reportsTop pytest PluginsErrata:I mentioned that Coverage has the ability to show context (which line is covered by which test) for the past year or so.However, that feature was released in Oct 2018. coverage 5.0 alpha That's over 6 years. Oops. Sorry Ned.  Learn pytestpytest 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 CourseBoth courses are at courses.pythontest.com ★ Support this podcast on Patreon ★
undefined
Jan 10, 2025 • 12min

pytest plugins - a full season

This episode kicks off a season of pytest plugins.In this episode:Introduction to pytest pluginsThe pytest.org pytest plugin listFinding pytest related packages on PyPIThe Top pytest plugins list on pythontest.comExploring popular pluginsLearning from plugin examplesLinks:Top pytest plugins listpytest.org plugin listTop PyPI PackagesAnd links to plugins mentioned in the show can be found at pythontest.com/top-pytest-plugins  Learn pytestpytest 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 CourseBoth courses are at courses.pythontest.com ★ Support this podcast on Patreon ★
undefined
Nov 17, 2024 • 21min

223: Writing Stuff Down is a Super Power

Discover how effective note-taking can enhance listening and memory retention. Explore strategies for organizing thoughts and tasks that lead to better productivity. Learn how documenting challenges can clarify problem-solving in programming. Delve into the importance of well-structured communication through emails and writing. Understand the unique role that notes play in mastering frameworks like PyTest, significantly boosting personal and professional accountability.
undefined
Sep 7, 2024 • 12min

222: Import within a Python package

In this episode we're talking about importing part of a package into another part of the same package.We'll look at: `from . import module` and `from .module import something`and also:  `import package` to access the external API from with the package.Why would we use `import package` if `from . import api` would work fine?  Learn pytestpytest 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 CourseBoth courses are at courses.pythontest.com ★ Support this podcast on Patreon ★
undefined
Jun 3, 2024 • 7min

221: How to get pytest to import your code under test

Exploring how to make pytest import your code under test including options like installing code with pip install -e /path/to/local/package and using the pythonpath pytest setting. Discussing the challenges of importing code for pytest and the benefits of packaging for distribution. Learning how to set the Python path in PyTest configuration files for code import.
undefined
May 4, 2024 • 40min

220: Getting the most out of PyCon, including juggling - Rob Ludwick

PyCon US is just around the corner.  I've asked Rob Ludwick to come on the show to discuss how to get the most out of your PyCon experience. There's a lot to do. A lot of activities to juggle, including actual juggling, which is where we start the conversation.Even if you never get a chance to go to PyCon, I hope this interview helps you get a feel for the welcoming aspect of the Python community.I recorded this interview as an episode for one of my other podcasts, Python People. But I think it's got some great pre-conference advice, so I'm sharing it here on Python Test as well.We talk about: - Juggling at PyCon- How to get the most out of PyCon    - Watching talks    - Hallway track    - Open spaces    - Lightening talks    - Expo hall / vendor space    - Poster sessions    - Job fair    - A welcoming community    - Tutorials     - Sprints    - But mostly about the people of Python and PyCon."Python enables smart people to work faster" - Rob Ludwick  Learn pytestpytest 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 CourseBoth courses are at courses.pythontest.com ★ Support this podcast on Patreon ★
undefined
40 snips
Apr 24, 2024 • 48min

219: Building Django Apps & SaaS Pegasus - Cory Zue

Cory Zue, creator of SaaS Pegasus & Django expert, talks about building Django apps, SaaS Pegasus, boilerplate projects, database choices, authentication options, Docker, deployment targets, front-end frameworks, HTMX vs React, and SaaS Pegasus. The podcast delves into Django deployment platforms, Tailwind UI integration, choosing between HTMLX and React, and a project for software individuals helping community projects.
undefined
Apr 18, 2024 • 28min

218: Balancing test coverage with test costs - Nicole Tietz-Sokolskaya

Nicole is a software engineer and writer, and recently wrote about the trade-offs we make when deciding which tests to write and how much testing is enough.We talk about:Balancing schedule vs testingHow much testing is the right about of testingShould code coverage be measured and trackedGood refactoring can reduce code coverageIs it worth testing error conditions?Are rare error codes ok to just monitor?API drift and autospecMitigating riskDeciding what to test and what not to testFocus testing on key money-making features If there's a bug in this part of the code, how much business impact is there?Performance testing needs to approximately match real world workloadsCost of a service breaking vs the cost of creating, maintaining, and running testsKeeping test suites quick to minimize getting distractedLinks:Too much of a good thing: the trade-off we make with tests Load testing is hard, and the tools are... not great. But why?Yet Another Rust Resource (YARR!)Goodhart's law - "When a measure becomes a target, it ceases to be a good measure"  Learn pytestpytest 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 CourseBoth courses are at courses.pythontest.com ★ Support this podcast on Patreon ★

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode