Test & Code - podcast cover

Test & Code

Brian Okkentestandcode.com
The Python Test Podcast hosted by Brian Okken
Download Metacast podcast app
Podcasts are better in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episodes

173: Why NOT unittest?

In the preface of "Python Testing with pytest" I list some reasons to use pytest, under a section called "why pytest?". Someone asked me recently, a different but related question "why NOT unittest?". unittest is an xUnit style framework. For me, xUnit style frameworks are fatally flawed for software testing. That's what this episode is about, my opinion of "Why NOT unittest?", or more broadly, "What are the fatal flaws of xUnit?" Links: Python Testing with pytest, Second Edition unittest docs u...

Dec 17, 202124 minSeason 1Ep. 173

172: Designing Better Software with a Prototype Mindset

A prototype is a a preliminary model of something, from which other forms are developed or copied. In software, we think of prototypes as early things, or a proof of concept. We don't often think of prototyping during daily software development or maintenance. I think we should. This episode is about growing better designed software with the help of a prototype mindset. Links: Selecting a programming language can be a form of premature optimization — Brett Cannon's blog post Help support the sho...

Nov 30, 20217 minSeason 1Ep. 172

171: How and why I use pytest's xfail - Paul Ganssle

Paul Ganssle, is a software developer at Google, core Python dev, and open source maintainer for many projects, has some thoughts about pytest's xfail. He was an early skeptic of using xfail, and is now an proponent of the feature. In this episode, we talk about some open source workflows that are possible because of xfail. Special Guest: Paul Ganssle. Links: How and why I use pytest's xfail — Paul's blog post mentioned in the episode Craft Minimal Bug Reports — Matthew Rocklin's article episode...

Nov 22, 202139 minSeason 1Ep. 171

170: pytest for Data Science and Machine Learning - Prayson Daniel

Prayson Daniel, a principle data scientist, discusses testing machine learning pipelines with pytest. Prayson is using pytest for some pretty cool stuff, including: unit tests, of course testing pipeline stages counterfactual testing performance testing All with pytest. So cool. Special Guest: Prayson Daniel. Links: Python Bytes 250, with Prayson Daniel — Listen to this for more of an introduction to Prayson Help support the show AND learn pytest: The Complete pytest course is now a bundle, with...

Nov 18, 202146 minSeason 1Ep. 170

169: Service and Microservice Performance Monitoring - Omri Sass

Performance monitoring and error detection is just as important with services and microservices as with any system, but with added complexity. Omri Sass joins the show to explain telemetry and monitoring of services and of systems with services. Special Guest: Omri Sass. Help support the show AND learn pytest: 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. U...

Nov 11, 202131 minSeason 1Ep. 169

168: Understanding Complex Code by Refactoring into Larger Functions

To understand complex code, it can be helpful to remove abstractions, even if it results in larger functions. This episode walks through a process I use to refactor code that I need to debug and fix, but don't completely understand. Help support the show AND learn pytest: 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 "...

Nov 02, 202112 minSeason 1Ep. 168

167: React, TypeScript, and the Joy of Testing - Paul Everitt

Paul has a tutorial on testing and TDD with React and TypeScript. We discuss workflow and the differences, similarities between testing with React/TypeScript and Python. We also discuss what lessons that we can bring from front end testing to Python testing. Special Guest: Paul Everitt. Links: React, TypeScript, and TDD — Paul Everitt's tutorial React Testing Library Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Pr...

Oct 22, 202138 minSeason 1Ep. 167

166: unittest expectedFailure and xfail

xfail isn't just for pytest tests. Python's unittest has @unittest.expectedFailure. In this episode, we cover: using @unittest.expectedFailure the results of passing and failing tests with expectedFailure using pytest as a test runner for unittest using pytest markers on unittest tests Docs for expectedFailure: https://docs.python.org/3/library/unittest.html#skipping-tests-and-expected-failures Some sample code. unittest only: import unittest class ExpectedFailureTestCase(unittest.TestCase): @un...

Oct 14, 20217 minSeason 1Ep. 166

165: pytest xfail policy and workflow

A discussion of how to use the xfail feature of pytest to help with communication on software projects. The episode covers: What is xfail Why I use it Using reason effectively by including issue tracking numbers Using xfail_strict Adding --runxfail when transitioning from development to feature freeze What to do about test failures How all of this might help with team communication Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separa...

Oct 07, 202110 minSeason 1Ep. 165

164: Debugging Python Test Failures with pytest

An overview of the pytest flags that help with debugging. From Chapter 13, Debugging Test Failures, of Python Testing with pytest, 2nd edition . pytest includes quite a few command-line flags that are useful for debugging. We talk about thes flags in this episode. Flags for selecting which tests to run, in which order, and when to stop: -lf / --last-failed: Runs just the tests that failed last. -ff / --failed-failed: Runs all the tests, starting with the last failed. -x / --exitfirst: Stops the ...

Sep 14, 202113 minSeason 1Ep. 164

163: pip install ./local_directory - Stéphane Bidoul

pip : "pip installs packages" or maybe "Package Installer for Python" pip is an invaluable tool when developing with Python. A lot of people know pip as a way to install third party packages from pypi.org You can also use pip to install from other indexes (or is it indices?) You can also use pip to install a package in a local directory. That's the part I want to jump in and explore with Stéphane Bidoul. The way pip installs from a local directory is about to change, and the story is fascinating...

Aug 20, 202129 minSeason 1Ep. 163

162: Flavors of TDD

What flavor of TDD do you practice? In this episode we talk about: Classical vs Mockist TDD Detroit vs London (I actually refer to it in the episode as Chicago instead of Detroit. Oh well.) Static vs Behavior Inside Out vs Outside In Double Loop TDD BDD FDD Tracer Bullets Rules of TDD Team Structure Lean TDD This is definitely an episode I'd like feedback on. Reach out to me for further questions or if I missed some crucial variant of TDD that you know and love. Links: Mocks Aren't Stubs - Marti...

Aug 03, 202123 minSeason 1Ep. 162

161: Waste in Software Development

Software development processes create value, and have waste, in the Lean sense of the word waste. Lean manufacturing and lean software development changed the way we look at value and waste. This episode looks at lean definitions of waste, so we can see it clearly when we encounter it. I'm going to use the term waste and value in future episodes. I'm using waste in a Lean sense, so we can look at software processes critically, see the value chain, and try to reduce waste. Lean manufacturing and ...

Jul 20, 202119 minSeason 1Ep. 161

160: DRY, WET, DAMP, AHA, and removing duplication from production code and test code

Should your code be DRY or DAMP or something completely different? How about your test code? Do different rules apply? Wait, what do all of these acronyms mean? We'll get to all of these definitions, and then talk about how it applies to both production code and test code in this episode. Links: The Pragmatic Programmer, 20th Anniversary Edition Don't repeat yourself - Wikipedia a-ha - Take On Me Rule of three - Wikipedia What does “DAMP not DRY” mean when talking about unit tests? - Stack Overf...

Jul 08, 202115 minSeason 1Ep. 160

159: Python, pandas, and Twitter Analytics - Matt Harrison

When learning data science and machine learning techniques, you need to work on a data set. Matt Harrison had a great idea: Why not use your own Twitter analytics data? So, he did that with his own data, and shares what he learned in this episode, including some of his secrets to gaining followers. In this episode we talk about: Looking at your own Twitter analytics data. Using Python, pandas, Jupyter for data cleaning and exploratory analysis Data visualization Machine learning, principal compo...

Jul 02, 202148 minSeason 1Ep. 159

158: TDD in Swift - Gio Lodi

Iterative processes that include writing test code and production code together, such as TDD, help make coding fun. All of us that care about developing quality code with the help of testing can learn from each other, regardless of programming language. Today we step outside our normal Python comfort zone and talk with Gio about TDD in Swift. Gio Lodi, author of TDD in Swift, joins the show to discuss Test Driven Development, software workflows, bottom up vs top down, rapid feedback, developer v...

Jun 18, 202143 minSeason 1Ep. 158

157: pre-commit - Anthony Sottile

pre-commit started as a framework for running linters and code formatters during git actions via git hooks. It's grown and expanded and now supports an extensive list of languages and actions and manual running of actions. But even at it's core, it's great for letting computers nitpick about whitespace and formatting, so that code reviews can focus on architecture and design. Anthony Sottile discusses pre-commit, for using locally by developers, and pre-commit.ci, which can run actions during me...

Jun 11, 202141 minSeason 1Ep. 157

156: Flake8: Python linting framework with Pyflakes, pycodestyle, McCabe, and more - Anthony Sottile

Flake8 is a command-line tool for linting Python projects. By default, it includes lint checks provided Pyflakes, pycodestyle, and McCabe It's also a platform, and allows plugins to extend the checks. Flake8 will run third-party extensions if they are found and installed. But what does all of that mean? Anthony Sottile is a maintainer of flake8 and has kindly offered to explain it to us. Links: Flake8: Your Tool For Style Guide Enforcement pyflakes pycodestyle mccabe pyflakes/messages.py flake8 ...

Jun 03, 202122 minSeason 1Ep. 156

155: Four Questions to Ask Frequently During Software Projects - Tim Ottinger

Tim Ottinger has four questions that work great in many situations, from doing homework, to cooking, to writing code, to entire software projects. They are actually awesome questions to ask during a software project. We discuss the questions, where they came from, and look at some uses in software. The questions: What is it that needs to be done? What do we need in order to do it? Where can we get what we need? How can we tell if we’re doing it right? Bonus question that can be swapped out for #...

May 28, 202122 minSeason 1Ep. 155

154: Don't Mock your Database - Jeff Triplett

You need tests for your web app. And it has a database. What do you do with the database during testing? Should you use the real thing? or mock it? Jeff Triplett says don't mock it. In this episode, we talk with Jeff about testing web applications, specifically Django apps, and of course talk about the downsides of database mocking. Links: "🤔 In ~12 years, I have never seen a case where mocking a database was a good idea. ..." Django News Moto Test & Code 103: Django - Lacey Williams Hensch...

May 21, 202130 minSeason 1Ep. 154

153: Playwright for Python: end to end testing of web apps - Ryan Howard

Playwright is an end to end automated testing framework for web apps with Python support and even a pytest plugin. Links: Playwright for Python Why Playwright? playwright-pytest Help support the show AND learn pytest: 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,...

May 14, 202132 minSeason 1Ep. 153

152: Python Packaging - Brett Cannon

I always learn a lot when I talk to Brett, and this episode is no exception. We talk about the packaging workflow, tools, changes, pyproject.toml, flit, setuptools, and so much more. I hope you learn as much as I did in this great discussion. Links: pytest-srcpaths Python Packaging User Guide pypa/packaging: Core utilities for Python packages flit and requires-python Extending and Embedding the Python Interpreter — Python 3.9.2 documentation Flit setuptools PEP 518 -- Specifying Minimum Build Sy...

May 07, 202150 minSeason 1Ep. 152

151: Python Adventure - Brandon Rhodes

Adventure, or Colossal Cave Adventure, was written between 1975 and 1977 in Fortran. Brandon Rhodes ported it to Python 3, initial release in 2011, and still maintains it. We talk to Brandon about this wonderful game. YOU ARE STANDING AT THE END OF A ROAD BEFORE A SMALL BRICK BUILDING. AROUND YOU IS A FOREST. A SMALL STREAM FLOWS OUT OF THE BUILDING AND DOWN A GULLY. >>> east A bit later... IT IS NOW PITCH DARK. IF YOU PROCEED YOU WILL LIKELY FALL INTO A PIT. >>> light(lamp) YO...

Apr 28, 202156 minSeason 1Ep. 151

150: A Practical Testing Strategy

Coming up with a testing strategy doesn't have to be stressful. Prioritizing features to test, and generating test cases for each feature can be fairly quick and painless. This episode covers a strategy for both that can be applied to many types of software. Help support the show AND learn pytest: 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 w...

Apr 15, 202111 minSeason 1Ep. 150

149: I don't test my code, "crappy Python" is all I write - Corey Quinn

Corey Quinn is the Chief Cloud Economist at The Duckbill Group. He's also a podcaster and writes a newsletter. And he also automates things with Python. But he doesn't write tests. Let's find out why. Reason for the interview. Rough summary of a twitter conversation: Corey: What podcasts should I try to get an invite onto? ToonArmyCaptain: Python Bytes, Test & Code, Talk Python Corey: But... I don't test my code, "crappy Python" is all I write, and I'd feel like a giant imposter. So yeah, I'...

Mar 31, 202150 minSeason 1Ep. 149

148: Coverage.py and testing packages

How do you test installed packages using coverage.py? Also, a couple followups from last week's episode on using coverage for single file applications. Links: episode 147: Testing Single File Python Applications/Scripts with pytest and coverage Specifying source files — Coverage.py documentation Testing & Packaging - Hynek ack Help support the show AND learn pytest: The Complete pytest course is now a bundle, with each part available separately. pytest Primary Power teaches the super powers ...

Mar 12, 202114 minSeason 1Ep. 148

147: Testing Single File Python Applications/Scripts with pytest and coverage

Have you ever written a single file Python application or script? Have you written tests for it? Do you check code coverage? This is the topic of this weeks episode, spurred on by a listener question. The questions: For single file scripts, I'd like to have the test code included right there in the file. Can I do that with pytest? If I can, can I use code coverage on it? The example code discussed in the episode: script.py def foo(): return 5 def main(): x = foo() print(x) if __name__ == '__main...

Mar 06, 202112 minSeason 1Ep. 147

146: Automation Tools for Web App and API Development and Maintenance - Michael Kennedy

Building any software, including web apps and APIs requires testing. There's automated testing, and there's manual testing. In between that is exploratory testing aided by automation tools. Michael Kennedy joins the show this week to share some of the tools he uses during development and maintenance. We talk about tools used for semi-automated exploratory testing. We also talk about some of the other tools and techniques he uses to keep Talk Python Training, Talk Python, and Python Bytes all up ...

Feb 28, 202148 minSeason 1Ep. 146

145: For Those About to Mock - Michael Foord

A discussion about mocking in Python with the original contributor of unittest.mock, Michael Foord. Of course we discuss mocking and unittest.mock. We also discuss: testing philosophy unit testing and what a unit is TDD where Michael's towel is, and what color Micheal was instrumental in the building of testing tools for Python, and continues to be a pragmatic source of honest testing philosopy in a field that has a lot of contradictory information. Links: unittest.mock - Python docs Mocks Aren'...

Feb 18, 202149 minSeason 1Ep. 145

144: TDD in Science - Martin Héroux

Test Driven Development, TDD, is not easy to incorporate in your daily development. Martin and Brian discuss TDD and testing and Martin's experience with testing, TDD, and using it for code involved with scientific research. We discuss lots of topics around this, including: What is TDD? Should research software be tested in order to be trusted? Time pressure and the struggle to get code done quickly. How do you make time for tests also? Is testing worth it for code that will not be reused? Somet...

Feb 13, 202154 minSeason 1Ep. 144
Hosted on Transistor
For the best experience, listen in Metacast app for iOS or Android
Open in Metacast