Test & Code cover image

Test & Code

Latest episodes

undefined
Dec 22, 2021 • 39min

pseudo-TDD - Paul Ganssle

In this episode, I talk with Paul Ganssle about a fun workflow that he calls pseudo-TDD. Pseudo-TDD is a way to keep your commit history clean and your tests passing with each commit. This workflow includes using pytest xfail and some semi-advanced version control features.Some strict forms of TDD include something like this:write a failing test that demonstrates a lacking feature or defectwrite the source code to get the test to passrefactor if necessaryrepeatIn reality, at least for me, the software development process is way more messy than this, and not so smooth and linear.Pauls workflow allow you to develop non-linearly, but commit cleanly.Full TranscriptLinks:A pseudo-TDD workflow using expected failuresepisode 171: How and why I use pytest's xfail - Paul Ganssleepisode 165: pytest xfail policy and workflowepisode 162: Flavors of TDD
undefined
Dec 17, 2021 • 24min

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?"Full TranscriptLinks:Python Testing with pytest, Second Editionunittest docsunittest assert methodsxUnit - Wikipedia
undefined
Nov 30, 2021 • 7min

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.Full TranscriptLinks:Selecting a programming language can be a form of premature optimization — Brett Cannon's blog post
undefined
Nov 22, 2021 • 38min

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. Full TranscriptSpecial Guest: Paul Ganssle.Links:How and why I use pytest's xfail — Paul's blog post mentioned in the episodeCraft Minimal Bug Reports — Matthew Rocklin's articleepisode 111: Subtests in Python with unittest and pytest - Paul Ganssleepisode 165: pytest xfail policy and workflowepisode 166: unittest expectedFailure and xfail
undefined
4 snips
Nov 18, 2021 • 45min

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 coursetesting pipeline stagescounterfactual testingperformance testingAll with pytest. So cool.Full TranscriptSpecial Guest: Prayson Daniel.Links:Python Bytes 250, with Prayson Daniel — Listen to this for more of an introduction to Prayson
undefined
Nov 11, 2021 • 30min

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. Full TranscriptSpecial Guest: Omri Sass.
undefined
Nov 2, 2021 • 11min

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.Full Transcript
undefined
Oct 22, 2021 • 37min

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.Full TranscriptSpecial Guest: Paul Everitt.Links:React, TypeScript, and TDD — Paul Everitt's tutorialReact Testing Library
undefined
Oct 14, 2021 • 6min

unittest expectedFailure and xfail

xfail isn't just for pytest tests. Python's unittest has @unittest.expectedFailure.In this episode, we cover:using @unittest.expectedFailurethe results of passing and failing tests with expectedFailureusing pytest as a test runner for unittestusing pytest markers on unittest testsDocs for expectedFailure:  https://docs.python.org/3/library/unittest.html#skipping-tests-and-expected-failuresSome sample code.  unittest only:import unittest class ExpectedFailureTestCase(unittest.TestCase): @unittest.expectedFailure def test_fail(self): self.assertEqual(1, 0, "broken") @unittest.expectedFailure def test_pass(self): self.assertEqual(1, 1, "not broken") unittest with pytest markers:import unittest import pytest class ExpectedFailureTestCase(unittest.TestCase): @pytest.mark.xfail def test_fail(self): self.assertEqual(1, 0, "broken") @pytest.mark.xfail def test_pass(self): self.assertEqual(1, 1, "not broken") Full Transcript
undefined
Oct 7, 2021 • 10min

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 xfailWhy I use itUsing reason effectively by including issue tracking numbersUsing xfail_strictAdding --runxfail when transitioning from development to feature freezeWhat to do about test failuresHow all of this might help with team communicationFull Transcript

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