Filtrar por género
- 240 - 238: So Long, and Thanks for All the Fish
A farewell to a fun 10 years.
Also, I should have tested it better. :)
In the audio I got the numbers wrong. Doh!
This is episode 238, not 237. Oh well.I'll still be around, of course, at:
pythontest.com - where I write about developing software with testspythonbytes.fm- Python news and headlines, delivered directly to your earbudsThanks for all the fun over the last 10 years.
I wish you the best.Fri, 15 Aug 2025 - 239 - 237: FastAPI Cloud - Sebastián Ramírez
In this episode, Brian interviews Sebastián Ramírez, creator of FastAPI, about its rapid rise in developer popularity and the launch of FastAPI Cloud. Sebastian explains how FastAPI Cloud addresses deployment challenges small teams face. He shares his transition from open-source to startup founder, focusing on simplifying deployment against the complexity of tools like Kubernetes.
Links:
FastAPI CloudFastAPISQLModelTyperOpenAPIPydanticSequoia Open Source FellowshipMon, 11 Aug 2025 - 238 - 236: Git Tips for Testing - Adam Johnson
In this episode, host Brian Okken and guest Adam Johnson explore essential Git features, highlighted by Adam's updated book, "Boost Your Git DX."
Key topics include
"cherry picking" for selective commits"git stash" for managing in-progress work"git diff", and specifically its `--name-only` flag, which provides a streamlined method for developers to identify which files have changed, which can be used to determine which tests need to be run"git bisect" for efficiently pinpointing bugs.This conversation offers valuable strategies for developers at any skill level to enhance their Git proficiency and optimize their coding workflows.
Boost Your Git DX - Adam's book
Links:Wed, 30 Jul 2025 - 237 - 235: pytest-django - Adam Johnson
In this episode, special guest Adam Johnson joins the show and examines pytest-django, a popular plugin among Django developers. He highlights its advantages over the built-in unittest framework, including improved test management and debugging. Adam addresses transition challenges, evolving fixture practices, and offers tips for optimizing test performance. This episode is a concise guide for developers looking to enhance their testing strategies with pytest-django.
Links:
pytest-django - a plugin for pytest that provides a set of useful tools for testing Django applications and projects.Tue, 22 Jul 2025 - 236 - 234: pytest-metadata - provides access to test session metadata
pytest-metadata is described as a plugin for pytest that provides access to test session metadata.
That is such a humble description for such a massively useful plugin.
If you're already using pytest-html, you have pytest-metadata already installed, as pytest-metadata is one of the dependencies for pytest-html.
However, pytest-metadata is very useful even on its own.Links:
pytest-metadata - The plugin we're talking about in this episodepytest-base-url - Adds the base URL to the metadata.pytest-html - Displays the metadata at the start of each report. See S2:E6: pytest-html - a plugin that generates HTML reports for test resultspytest-reporter-html1 - Presents metadata as part of the report.pytest-selenium - Adds the driver, capabilities, and remote server to the metadata.If you've got other plugins that work well with pytest-metadata, please let me know.
Wed, 07 May 2025 - 235 - 233: pytest-check - allow multiple failures per test
pytest-check is a pytest plugin that allows multiple failures per test.
Normally, a test function will fail and stop running with the first failed assert. That's totally fine for tons of kinds of software tests. However, there are times where you'd like to check more than one thing, and you'd really like to know the results of each check, even if one of them fails.
pytest-check allows multiple failed "checks" per test function, so you can see the whole picture of what's going wrong.Links:
pytest-checkTop pytest pluginsFri, 02 May 2025 - 234 - 232: The role of AI in software testing - Anthony Shaw
AI is helping people write code.
Tests are one of those things that some people don't like to write.Can AI play a role in creating automated software tests?
Well, yes. But it's a nuanced yes.Anthony Shaw comes on the show to discuss the topic and try to get AI to write some test for my very own cards project.
We discuss:
The promise of AI writing your tests for youDownsides to not writing tests yourselfBad ways to generate testsGood ways to ask AI for help in writing testsTricks to get better results while using copilot and other AI toolsLinks:
The cards projectA video version of this discussion: Should AI write tests?Fri, 25 Apr 2025 - 233 - 231: pytest-repeat - works fine on Python 3.14
pytest-repeat
is a pytest plugin that makes it easy to repeat a single test, or multiple tests, a specific number of times. works fine on Python 3.14is tested on Python 3.9-3.14probably works fine still on 3.7 & 3.8This episode also discusses the attempted April Fools episode.
Links:
pytest-repeatThe April Fools episode: Python 3.14 won't repeat with pytest-repeat
Thu, 10 Apr 2025 - 232 - 230: Python 3.14 won't repeat with pytest-repeat
pytest-repeat is a pytest plugin that makes it easy to repeat a single test, or multiple tests, a specific number of times.
Note: This was an April Fools attempt, so the statement ...
"Unfortunately, it doesn't seem to work with Python 3.14, even though there is no rational reason why it shouldn't work."
... is NOT true.Listen to the NEXT episode to get an explanation
Links:
pytest-repeatNext episode: pytest-repeat - works fine on Python 3.14Tue, 01 Apr 2025 - 231 - 229: pytest-html - a plugin that generates HTML reports for test results
pytest-html has got to be one of my all time favorite plugins.
pytest-htmlrepo readme with screenshotenhancing reportspytest-metadata
pytest-html is a plugin for pytest that generates a HTML report for test results.
This episode digs into some of the super coolness of pytest-html.Thu, 27 Mar 2025 - 230 - 228: pytest-md and pytest-md-report: Markdown reports for pytest
Markdown reports as either text or markdown tables.
Two fun plugins discussed.Links:
pytest-md-reportpytest-mdTop pytest PluginsFri, 28 Feb 2025 - 229 - 227: 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 episode
Introduction 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 testingFri, 07 Feb 2025 - 228 - 226: pytest-mock : Mocking in pytest
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 awesomeWhat is mocking, patching, and monkey patchingWhat, if any, is the difference between mock, fake, spy, stub. Why we might need these in testingSome history of mock in Python and how mock became unittest.mockFrom unittest.mockpatch.objectpatch.object with autospecusing these as context managerspytest-mock:The mocker fixture Cleanup in teardownUsing mocker.patch, mocker.spy, and mocker.stubWhy it's awesome and why you might want to use it over straight unittest.mockLinks:
top pytest plugins listpytest-mock documentationunittest.mockPodcast episode discussing unittest.mock with Michael FoordmonkeypatchFri, 31 Jan 2025 - 227 - 225: 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.Thu, 23 Jan 2025 - 226 - 224: pytest plugins - a full series
This episode kicks off a series on 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-pluginsFri, 10 Jan 2025 - 225 - 223: Writing Stuff Down is a Super Power
Taking notes well can help to listen better, remember things, show respect, be more accountable, free up mind space to solve problems.
This episode discusses
the benefits of writing things downpreparing for a meetingtaking notes in meetingsreviewing notes for action items, todo items, things to follow up on, etc.taking notes to allow for better focuswriting well structured emailswriting blog posts and booksSat, 16 Nov 2024 - 224 - 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?
Sat, 07 Sep 2024 - 223 - 221: How to get pytest to import your code under test
We've got some code we want to test, and some tests.
The tests need to be able to import the code under test, or at least the API to it, in order to run tests against it.
How do we do that? How do we set things up so that our tests can import our code?In this episode, we discuss two options:
Installing the code under test as a pip installable package with `pip install -e /path/to/local/package`.Using the pythonpath pytest setting.Mon, 03 Jun 2024 - 222 - 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
Sat, 04 May 2024 - 221 - 219: Building Django Apps & SaaS Pegasus - Cory Zue
I'm starting a SaaS project using Django, and there are tons of decisions right out of the gate.
To help me navigate these decisions, I've brought on Cory Zue.
Cory is the creator of SaaS Pegasus, and has tons of experience with Django.Some of the topics discussed:
Building Django applicationsSaaS Pegasusplacecard.meWhat boilerplate projects areDjango cookiecutterCookiecutterWhich database to use, probably PostgreSQLAuthentication choises, probably AllauthDocker, Docker for development, Docker for deploymentDeployment targets / hosting services. Render, Heroku, Fly.io, for PaaS options.Front end frameworks. Bootstrap, Tailwind, DaisyUI, TailwindUIHTMX vs React vs straight Django templatesRocketsFont Awesomeand of course, SaaS PegasusTue, 23 Apr 2024 - 220 - 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"Wed, 17 Apr 2024 - 219 - 217: Podcasting / SaaS / Work Life Balance - Justin Jackson
If you've ever thought about starting a podcast or a SaaS project, you'll want to listen to this episode.
Justin is one of the people who motivated me to get started podcasting.
He's also running a successful SaaS company, transistor.fm, which hosts this podcast.Topics:
PodcastingBuilding new SaaS (software as a service) productsBalancing work, side hustle, and familyGreat places to snowboard in British ColumbiaBTW.
Links from the show:
Transistor.fm - excellent podcast hosting, Justin is a co-founderHow to start a podcast in 2024Podcasts from JustinBuild your SaaS - currentBuild & Launch - an older one, but greatMegaMaker - from 2021 / 2022Thu, 11 Apr 2024 - 218 - 216: ruff, uv, and Astral: Python tooling, much faster, with Rust
Charlie Marsh and team are using Rust to make Python tooling faster.
Ruff can take the place of Flake8, isort, and Black, and so much more.uv can take the place of pip, pip-tools, and virtualenvAstral is Charlie's venture backed company, and what they have with `ruff` and `uv` is just the start.Since uv is the newest tool, there's quite a bit of the discussion diving into uv.
Links:
ruffAstraluvMon, 11 Mar 2024 - 217 - 215: Staying Technical as a Manager
Software engineers that move into leadership roles have a struggle between learning leadership skills, maintaining technical skills, and learning new leadership and technical skills.
Matt Makai went from individual contributor to developer relations to leadership in devrel.
We discuss how to stay technical, as well as dive into some results of his studies in how companies use developer relationship channels.Sun, 25 Feb 2024 - 216 - 214: Python Testing in VS Code
If you haven't tried running automated tests, especially with pytest, in VS Code recently, you should take another look.
The Python for VS Code interface for testing, especially for pytest, has changed recently.
On this episode we discuss the change with the software engineer working on the pytest changes, Eleanor Boyd, and the product manager, Courtney Webster.Links from the episode:
Blog post announcing the rewrite Code repo for questions, comments, issues etcTue, 06 Feb 2024 - 215 - 213: Repeating Tests
If a test fails in a test suite, I'm going to want to re-run the test. I may even want to re-run a test, or a subset of the suite, a bunch of times.
pytest-repeatpytest-rerunfailurespytest-flakefinderpytest-instafail
There are a few pytest plugins that help with this:We talk about each of these in this episode.
Fri, 19 Jan 2024 - 214 - 212: Canon TDD - by Kent Beck
In 2002, Kent Beck released a book called "Test Driven Development by Example".
In December of 2023, Kent wrote an article called "Canon TDD".
With Kent's permission, this episode contains the full content of the article.Brian's commentary is saved for a followup episode.
Links:
Canon TDDTest Driven Development by ExampleSat, 13 Jan 2024 - 213 - 211: Stamp out test dependencies with pytest plugins
We want to be able to run tests in a suite, and debug them in isolation, and have the behavior be the same.
If the behavior is different in isolation vs in a suite, it's a nightmare to debug.In this episode, we'll talk about:
Causes of dependenceTesting for dependencies using pluginsDebugging test dependenciesPlugins discussed:
pytest-randomlypytest-reversepytest-random-orderFri, 15 Dec 2023 - 212 - 210: TDD - Refactor while greenWed, 29 Nov 2023
- 211 - 209: Testing argparse Applications
How do you test the argument parsing bit of an application that uses argparse?
This episode covers:
Design for Test: Structuring your app or script so it's easier to test.pytest & capsys for testing stdoutAdding debug and preview flags for debugging and testingAnd reverting to subprocess.run if you can't modify the code under testAlso, there's a full writeup and code samples available:
Blog post: Testing argparse Applications Code RepoThu, 16 Nov 2023 - 210 - 208: Tests with no assert statements
Why on earth would you want to write a test with no assert statements?
After all, aren't assert statements how you decide wether a test passes or fails?In this episode, we walk through a handful of useful examples of test code without asserts.
We also talk about how these types of tests are a great way to dip your toe into testing.Sun, 29 Oct 2023 - 209 - 207: pytest course, pytest-repeat and pytest-flakefinderNew course: "The Complete pytest Course"pytest-repeat, which I'm starting to contribute toGive `--repeat-scope` a try. You can use it to change from repeating every test to repeating the session, module, or class.pytest-flakefinder, which is an alternative to pytest-repeatpytest-check is completely unrelated, but mentioned in the showMon, 25 Sep 2023
- 208 - 206: TDD in Context
TDD (Test Driven Development) started from Test First Programming, and has been around at least since the 90's.
However, software tools and available CI systems have changed quite a bit since then.
Maybe it's time to re-examine the assumptions, practices, processes, and principles of TDD.
At least in the context of my software engineering career, modifications to TDD, at least the version of TDD as it's frequently taught, have been necessary.This is the start of a series focused on examining TDD and related lightweight practices and processes.
Links from the show:
From XPTest FirstUnit TestsAcceptance TestsTest-Driven Development (wikipedia)Wed, 23 Aug 2023 - 207 - 205: pytest autouse fixtures
On a recent episode of PythonBytes, I suggested it's hard to come up with good examples for pytest autouse fixtures, as there aren't very many good reasons to use them. James Falcon was kind enough to reach out and correct me.
In this episode, we describe:
what fixtures arewhat autouse fixtures aregreat reasons to use themMon, 31 Jul 2023 - 206 - 204: Free Your Inner Nonfiction Writer - Johanna Rothman
Learn how to write nonfiction fast and well.
Johanna Rothman joins the show to discuss writing nonfiction.Johanna's book: Free Your Inner Nonfiction Writer
Tue, 18 Jul 2023 - 205 - 203: Open Source at IntelMon, 17 Jul 2023
- 204 - 202: Using Towncrier to Keep a Changelog - Hynek Schlawack
Hynek joins the show to discuss towncrier.
At the top of the towncrier documentation, it says "towncrier is a utility to produce useful, summarized news files (also known as changelogs) for your project."
Towncrier is used by "Twisted, pytest, pip, BuildBot, and attrs, among others."
This is the last of 3 episodes focused on keeping a CHANGELOG.
Episode 200 kicked off the series with keepachangelog.com and Olivier Lacan
In 201 we had Ned Batchelder discussing scriv.Special Guest: Hynek Schlawack.
Links:
Towncrier docsHow to Keep a Changelog in Markdown - Towncrier docsKeep a Changelogstructlog/CHANGELOG.md — Example of manually edited changelog.hatch-fancy-pypi-readmeMyST Markdown hatchlingWed, 31 May 2023 - 203 - 201: Avoid merge conflicts on your CHANGELOG with scriv - Ned Batchelder
Last week we talked about the importance of keeping a changelog.
This week we talk with Ned Batchelder about scriv, a tool to help maintain that changelog.Scriv "is a command-line tool for helping developers maintain useful changelogs. It manages a directory of changelog fragments. It aggregates them into entries in a CHANGELOG file."
Links:
nedbat/scriv: Changelog management toolThu, 25 May 2023 - 202 - 200: Keep a CHANGELOG
A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project.
This episode is about what a changelog is, with an interview with Olivier Lacan, creator of keepachangelog.com.
The next two episodes talk about some tools to help software project teams keep changelogs while avoiding merge conflicts.Special Guest: Olivier Lacan.
Links:
Shields.ioKeep a Changelog"The Changelog" Podcast interview with Olivier LacanAn Open Source Rage DiamondFri, 19 May 2023 - 201 - 199: Is Azure Right for a Side Project? - Pamela Fox
For a web side project to go from "working on desktop" to "live in the cloud", one decision that needs to be made is where to host everything. One option is Microsoft Azure. Lots of corporate sites use it. Is it right for side projects?
Pamela Fox, a Cloud Advocate for Python at Microsoft, joins the show to help us with that question.
Links:
Python Bytes Episode #323pamelafox gitHub projectsDeploy a Python (Django or Flask) web app to AzureHosting Python Web Apps on Azure: A Price-OffDeploying a containerized FastAPI app to Azure Container AppsGetting started with hosting Python apps on AzurePricing Calculator for AzureApp Service Pricing pamelafox/flask-db-quiz-exampleTutorial: Deploy a Python Django or Flask web app with PostgreSQLPamela Fox on MastodonThu, 04 May 2023 - 200 - 198: Testing Django Web Applications - Carlton Gibson, Will VincentThu, 27 Apr 2023
- 199 - 197: Python project trove classifiers - Do you need this bit of pyproject.toml metadata? - Brett Cannon
Classifiers are one bit of Python project metadata that predates PyPI.
Classifiers are weird.
They were around in setuptools days, and are still here with pyproject.toml.
What are they? Why do we need them? Do we need them?Which classifiers should I include?Why are they called "trove classifiers" in the Python docsBrett Cannon joins the show to discuss these wacky bits of metadata.
Here's an example, from pytest-crayons:
[project] ... classifiers = [ "License :: OSI Approved :: MIT License", "Framework :: Pytest" ]Links:
Classifiers · PyPIPEP 621 – Storing project metadata in pyproject.toml | peps.python.orgPackaging Python Projects — Python Packaging User Guide — Configuring metadataPEP 639 – Improving License Clarity with Better Package Metadata | peps.python.orgSPDXTue, 04 Apr 2023 - 198 - 196: I am not a supplier - Thomas Depierre
Should we think of open source components the same way we think of physical parts for manufactured goods?
There are problems with supply chain analogy when applied to software.
Thomas Depierre discusses some of those issues in this episode.
Links:
I am not a supplier - articleThu, 30 Mar 2023 - 197 - 195: What would you change about pytest? - Anthony Sottile
Anthony Sottile and Brian discuss changes that would be cool for pytest, even unrealistic changes. These are changes we'd make to pytest if we didn't ahve to care about backwards compatibilty.
Anthony's list:
- The import systemMulti-process support out of the boxAsync supportChanges to the fixture systemExtend the assert rewriting to make it modularAdd matchers to assert mechanismBan test class inheritance
Brian's list:
- Extend assert rewriting for custom rewriting, like checkpytester matchers available for all testsThrow out nose and unittest compatibility pluginsThrow out setup_module, teardown_module and other xunit style functionsRemove a bunch of the hook functionsDocumentation improvement of remaining hook functions which include examples of how to use itStart running tests before collection is doneSplit collection and running into two processesHave the fixtures be able to know the result of the test during teardown
Links:
anthonywritescode - YouTubeanthonywritescode - Twitchpytest-asyncio · PyPIasync test patterns for pytestfuture-fstrings · PyPIre-assert · PyPInumpy.testingSourcegraphWed, 08 Mar 2023 - 195 - 193: The Good Research Code Handbook - Patrick Mineault
I don't think it's too much of a stretch to say that software is part of most scientific research now.
From astronomy, to neuroscience, to chemistry, to climate models.
If you work in research that hasn't been affected by software yet, just wait.But how good is that software?
How much of common best practices in software development are making it to those writing software in the sciences?
Patrick Mineault has written "The Good Research Code Handbook".
It's a website. It's concise.
And it will put you on the right path to writing better software.
Even if you don't write science based software, and even if you already have a CS degree, there's some good information worth reading.Special Guest: Patrick Mineault.
Links:
The Good Research Code Handbookgame-wrath-jam: A game jam game, theme: WrathRobotron 2084 - Arcade - YouTubeThe Book of Why: The New Science of Cause and EffectTue, 30 Aug 2022 - 194 - 192: Learn to code through game development with PursuedPyBear - Piper Thunstrom
The first game I remember coding, or at least copying from a magazine, was in Basic. It was Lunar Lander.
Learning to code a game is a way that a lot of people get started and excited about programming.
Of course, I don't recommend Basic. Now we've got Python. And one of the game engines available for Python is PursuedPyBear, a project started by Piper Thunstrom.
Piper joins us this episode and we talk about PursuedPyBear, learning to code, and learning CS concepts with game development.
PursuedPyBear, ppb, is a game framework great for learning with, with goals of being fun, education friendly, an example of idiomatic Python, hardware library agnostic, and built on event driven and object oriented concepts.
Special Guest: Piper Thunstrom.
Links:
PursuedPyBear | Unbearably Fun Game DevelopmentPiper's BlogMaking Games With PPB - PyTexasShooter Game by Piper Thunstromshootergame on GitHubBriefcase— BeeWaregame-blink: A tiny emergent behavior toy.Combat (Atari 2600) — The tank game I didn't remember the name of.Lunar LanderSat, 06 Aug 2022 - 193 - 191: Running your own site for fun and absolutely no profit whatsoever - Brian Wisti
Having a personal site is a great playground for learning tons of skills. Brian Wisti discusses the benefits of running a his own blog over the years.
Links:
Random GeekeryJamstackEleventyNetlifyPlausible AnalyticspytestBeautiful Souppyinvoke - Invoke!rsyncInternet Archive : archive.orgRichStatamicjamstack.orgA static site generator should be your next language learning projectFri, 01 Jul 2022 - 192 - 190: Testing PyPy - Carl Friedrich Bolz-Tereick
PyPy is a fast, compliant alternative implementation of Python.
cPython is implemented in C.PyPy is implemented in Python.
What does that mean?And how do you test something as huge as an alternative implementation of Python?
Special Guest: Carl Friedrich Bolz-Tereick.
Links:
PyPyHow is PyPy Tested? PyPy SpeedPython Speed CenterTue, 21 Jun 2022 - 191 - 189: attrs and dataclasses - Hynek Schlawack
In Python, before dataclasses, we had attrs.
Before attrs, it wasn't pretty.The story of attrs and dataclasses is actually intertwined.
They've built on each other.
And in the middle of it all, Hynek.Hynek joins the show today to discuss some history of attrs and dataclasses, and some differences.
If you ever need to create a custom class in Python, you should listen to this episode.
Links:
attrs documentationHistory of attrs and introduction to attrs namespacecattrs: Complex custom class converters for attrs. — python-attrsPEP 557 – Data ClassesPEP 681 – Data Class TransformsTue, 07 Jun 2022 - 190 - 188: Python's Rich, Textual, and Textualize - Innovating the CLI
Will McGugan has brought a lot of color to CLIs within Python due to Rich.
Then Textual started rethinking full command line applications, including layout with CSS.
And now Textualize, a new startup, is bringing CLI apps to the web.Links:
richrich-clitextualTextualize.ioRich GalleryTextualize GalleryPython Bytes PodcastTue, 17 May 2022 - 189 - 187: Teaching Web Development, including Front End Testing
When you are teaching someone web development skills, when is the right time to start teaching code quality and testing practices?
Karl Stolley believes it's never too early. Let's hear how he incorporates code quality in his courses.
Our discussion includes:
starting people off with good dev practices and toolslintinghtml and css validationvisual regression testingusing local dev servers, including httpsincorporating testing with git hookstesting to aid in css optimization and refactoringBackstopNightwatchBrowserStackthe tree legged stool of learning and progressing as a developer: testing, version control, and documentationKarl is also writing a book on WebRTC, so we jump into that a bit too.
Links:
BackstopNightwatchBrowserStackProgramming WebRTC: Build Real-Time Streaming Applications for the Web by Karl StolleyFri, 13 May 2022 - 188 - 186: Developer and Team Productivity
Being productive is obviously a good thing.
Can we measure it?
Should we measure it?
There's been failed attempts, like lines of code, etc. in the past.
Currently, there are new tools to measure productivity, like using git metrics.Nick Hodges joins the show to discuss the good and the bad of developer and team productivity, including how we can improve productivity.
Thu, 12 May 2022 - 187 - 185: Python + Django + Rich + Testing == Awesome
Django has a handful of console commands to help manage and develop sites.
django-rich adds color and nice formatting. Super cool.
In a recent release, django-rich also adds nice colorized tracebacks to the Django test runner.Links:
django-rich · PyPIepisode 181: Boost Your Django DX - Adam Johnsondjango-crispy-formsPython Developers Survey 2020 ResultsWed, 11 May 2022 - 186 - 184: Twisted and Testing Event Driven / Asynchronous Applications - Glyph
Twisted has been supporting asynchronous / event driven applications way before asyncio. Twisted, and Glyph, have also been encouraging automated tests for a very long time.
Twisted uses a technique that should be usable by other applications, even those using asyncio or other event driven architectures.
Links:
Community Service Award Recipient Glyph Lefkowitz — The PSF article I was referring to early in the episode Twistedtwisted/kleintwisted/treqdjango/daphne — Django Channels HTTP/WebSocket serverScrapySo Easy You Can Even Do It in JavaScript: Event-Driven Architecture for Regular Programmers - YouTubeFeature test - twitter engineeringPython Testing with pytest — Some reading for Glyph if he wants to learn to love pytestpytest-twistedpygamePyodideBrythonMon, 21 Mar 2022 - 185 - 183: Managing Software Teams - Ryan Cheley
Ryan Cheley joins me today to talk about some challenges of managing software teams, and how to handle them.
We end up talking about a lot of skills that are excellent for software engineers as well as managers.Some topics discussed:
handling code reviewsasking good questionsbeing honest about what you can't do with current resources and datadiscussing tradeoffs and offering solutions that can be completed faster than the ideal solutionbalancing engineering and managingmaking sure documentation happensremote teams encouraging collaborationencouraging non-work-related conversationswatching out for overworkingWed, 16 Mar 2022 - 184 - 182: An Unorthodox Technical Interview and Hiring Process - Nathan Aschbacher
Don't you just love technical interviews, with someone who just saw your resume or CV 5 minutes ago asking you to write some code on a whiteboard. Probably code that has nothing to do with anything you've done before or anything you will do at the company.
No? Neither does Nathan Aschbacher.
So when he started building the team at his company, he decided to do things differently.Hiring is one of the essential processes for building a great team.
However, it's a high noise, low signal process.Nathan Aschbacher has a relatively unorthodox tech hiring approach.
He's trying to make it very humane, with a better signal to noise ratio.Nathan is not intereseted in bizarre interview processes where the interviewer doesn't know anything about the interviewee beforehand, all people are asked the same questions, and people are asked to code on white boards.
Instead, he states "if the goal is to try to figure out if the person can do the work with your team, and your trying to build the team that you are adding this person to, they need to know what the team is like, and determine if they want to be part of the team, and the team needs to know what the person is like and if they would be addititve to the team.
So what's Nathan's process:
Screening resumes and CVs, looking for internal motivation to become an expert at something.Basic phone screen, very informal.A couple 2-3 hour pairings with someone on the team with whatever they are working on.Debriefing both the candidate and the team afterwords.Giving the candidate an opportunity for a second impression and following up on difficulties during the pairings.We discuss the process, and also:
trying to remove the barriers to team integration treating people as humansAnd of course, there's the story of how Nathan ended up interviewing someone with Zoo experience an no technical experience for a technical role. Of course, it was a misunderstanding of a job requirement around experience with ZooKeeper. But it's a good story.
Tue, 08 Mar 2022 - 183 - 181: Boost Your Django DX - Adam Johnson
We talk with Adam Johnson about his new book, "Boost Your Django DX".
Developer experience includes tools and practices to make developers more effective and efficient, and just plain make software development more fun and satisfying.
One of the things I love about this book is that it's not just for Django devs.
I'd guess that about half the book is about topics that all Python developers would find useful, from virtual environments to linters to testing.
But of course, also tons of tips and tools for working with Django.Links:
“Boost Your Django DX” Released— Adam's announcementBoost Your Django DX — The bookMon, 28 Feb 2022 - 182 - 180: Lean TDD
Lean TDD is an attempt to reconcile some conflicting aspects of Test Driven Development and Lean Software Development.
I've mentioned Lean TDD on the podcast a few times and even tried to do a quick outline at the end of episode 162.
This episode is a more complete outline, or at least a first draft.
If you feel you've got a good understanding of TDD, and it's working awesome for you, that's great. Keep doing what you're doing. There are no problems.
For me, the normal way TDD is taught just doesn't work. So I'm trying to come up with a spin on some old ideas to make it work for me. I'm hoping it works for you as well.
I'm calling the new thing Lean TDD. It's inspired by decades of experience writing software and influence from dozens of sources, including Pragmatic Programmer, Lean Software Development, Test-Driven Development by Example, and many blog posts and wiki articles.
The main highlights, however, come from the collision of ideas between Lean and TDD and how I've tried to resolve the seemingly opposing processes.
Links:
Lean TDD | pythontest.comepisode 162: Flavors of TDDWhat is Test Driven Development (TDD)? | Agile AllianceTest First Programming / Test First Development | pythontest.comepisode 7: The Waterfall Model and “Managing the Development of Large Software Systems”episode 51: Feature TestingThe testing renaissance — Twitter Engineering blog post about Feature TestingLean software development - WikipediaMon, 21 Feb 2022 - 181 - 179: Exploratory TestingTue, 08 Feb 2022
- 180 - 178: The Five Factors of Automated Software Testing
"There are five practical reasons that we write tests. Whether we realize it or not, our personal testing philosophy is based on how we judge the relative importance of these reasons." - Sarah Mei
This episode discusses the factors.
Sarah's order:
- Verify the code is working correctlyPrevent future regressionsDocument the code’s behaviorProvide design guidanceSupport refactoring
Brian's order:
- Verify the code is working correctlyPrevent future regressionsSupport refactoringProvide design guidanceDocument the code’s behavior
The episode includes reasons why I've re-ordered them.
Links:
Five Factor Testing - Sarah MeiMon, 31 Jan 2022 - 179 - 177: Unit Test vs Integration Test and The Testing Trophy
A recent Twitter thread by Simon Willison reminded me that I've been meaning to do an episode on the testing trophy.
This discussion is about the distinction between unit and integration tests, what those terms mean, and where we should spend our testing time.Links:
Simon Willison's Twitter ThreadThe Testing Trophy and Testing Classifications — Kent C DoddsWrite tests. Not too many. Mostly integration. — Kent C DoddsOn the Diverse And Fantastical Shapes of Testing — Martin FowlerThu, 27 Jan 2022 - 178 - 176: SaaS Side Projects - Brandon Braner
The idea of having a software as a service product sound great, doesn't it?
Solve a problem with software. Have a nice looking landing page and website. Get paying customers.
Eventually have it make enough revenue so you can turn it into your primary source of income.
There's a lot of software talent out there. We could solve lots of problems.
But going from idea to product to first customer is non-trivial.
Especially as a side hustle.
This episode discusses some of the hurdles from idea to first customer.Brandon Braner is building Released.sh. It's a cool idea, but it's not done yet.
Brandon and I talk about building side projects:
finding a target audiencelimiting scope to something doable by one personbuilding a great looking landing pagefinding time to work on thingsprioritizing and planninglearning while buildingeven utilizing third party services to allow you to launch fasterand last, but not least, having funSpecial Guest: Brandon Braner.
Links:
ReleasedTailwind CSS Tailwind UIFigmaHerokuGoogle App EngineTue, 18 Jan 2022 - 177 - 175: Who Should Do QA?Who should do QA?How does that change with different projects and teams?What does "doing QA" mean, anyway?
Answering these questions are the goals of this episode.
Links:
Test Automation - Who Should be Involved? | ThoughtworksWed, 12 Jan 2022 - 176 - 174: 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.
Links:
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 TDDWed, 22 Dec 2021 - 175 - 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 Editionunittest docsunittest assert methodsxUnit - WikipediaFri, 17 Dec 2021 - 174 - 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 postTue, 30 Nov 2021 - 173 - 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 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 xfailMon, 22 Nov 2021 - 172 - 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 coursetesting pipeline stagescounterfactual testingperformance testingAll with pytest. So cool.
Special Guest: Prayson Daniel.
Links:
Python Bytes 250, with Prayson Daniel — Listen to this for more of an introduction to PraysonWed, 17 Nov 2021 - 171 - 169: Service and Microservice Performance Monitoring - Omri SassThu, 11 Nov 2021
- 170 - 168: Understanding Complex Code by Refactoring into Larger FunctionsTue, 02 Nov 2021
- 169 - 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 tutorialReact Testing LibraryThu, 21 Oct 2021 - 168 - 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.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.
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 only: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")Thu, 14 Oct 2021 - 167 - 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 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 communicationThu, 07 Oct 2021 - 166 - 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 tests session afterEd: after?Author: yep the first failure.--maxfail=num: Stops the tests after num failures.-nf / --new-first: Runs all the tests, ordered by file modification time.--sw / --stepwise: Stops the tests at the first failure. Starts the tests at the last failure next time.--sw-skip / --stepwise-skip: Same as --sw, but skips the first failure.Flags to control pytest output:
-v / --verbose Displays all the test names, passing or failing.--tb=[auto/long/short/line/native/no] Controls the traceback style.-l / --showlocals Displays local variables alongside the stacktrace.Flags to start a command-line debugger:
--pdb Starts an interactive debugging session at the point of failure.--trace Starts the pdb source-code debugger immediately when running each test.--pdbcls Uses alternatives to pdb, such as IPython’s debugger with –-pdbcls=IPython.terminal.debugger:TerminalPdb.This list is also found in Chapter 13 of Python Testing with pytest, 2nd edition.
The chapter is "Debugging Test Failures" and covers way more than just debug flags, while walking through debugging 2 test failures.Links:
Python Testing with pytest — The fastest way to get up to speed on pytest.all pytest flags in pytest 6.2.xTue, 14 Sep 2021 - 165 - 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.Special Guest: Stéphane Bidoul.
Links:
The Odoo Community AssociationPEP 610 -- Recording the Direct URL Origin of installed distributions | Python.orgPEP 660 -- Editable installs for pyproject.toml based builds (wheel based) | Python.org — Bidoulpip install --no-index --find-links Solving issues related to out-of-tree builds · Issue #7555 · pypa/pippip list json formatFri, 20 Aug 2021 - 164 - 162: Flavors of TDD
What flavor of TDD do you practice?
In this episode we talk about:
Classical vs Mockist TDDDetroit vs London (I actually refer to it in the episode as Chicago instead of Detroit. Oh well.)Static vs BehaviorInside Out vs Outside InDouble Loop TDDBDDFDDTracer BulletsRules of TDDTeam StructureLean TDDThis 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 - Martin FowlerMockists Are Dead. Long Live Classicists.Double Loop TDDBDD: Behavior-driven developmentFDD: Feature-driven developmentMy reaction to “Is TDD Dead?” - pythontest.comTest First Programming / Test First DevelopmentHumorous list of TDD variants — BDD = Buzzword Driven Development, CDD = Calendar Driven Development, etcTue, 03 Aug 2021 - 163 - 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 lean software development caused people to talk about and examine waste and value, even in fields where we didn't really think about waste that much to begin with.
Software is just ones and zeros. Is there waste?
When I delete a file, nothing goes into the landfill.The mistake I'm making here is confusing the common English definition of waste when what we're talking about is the Lean definition of waste.
This episode tries to clear up the confusion.
Links:
Big Design Up FrontLightweight MethodologiesManifesto for Agile Software DevelopmentExtreme programmingThe New MethodologyTest First Programming / Test First DevelopmentTest Driven DevelopmentThe Pragmatic ProgrammerSix SigmaDMAICLean software developmentLean manufacturingThe Toyota WayLean Six SigmaDefinition of Waste by Merriam-WebsterTue, 20 Jul 2021 - 162 - 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 EditionDon't repeat yourself - Wikipediaa-ha - Take On MeRule of three - WikipediaWhat does “DAMP not DRY” mean when talking about unit tests? - Stack OverflowThu, 08 Jul 2021 - 161 - 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 analysisData visualizationMachine learning, principal component analysis, clusteringModel drift and re-running analysisWhat kind of tweets perform wellAnd much moreLinks:
Applied Pandas: Twitter Analytics — the courseFri, 02 Jul 2021 - 160 - 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 vs customer facing tests, and more.
Links:
TDD in Swift with SwiftUI and Combinemokacoding - Gio's blogXCTestSoftware Design: Tidy First? - Kent Beck on SubstackFri, 18 Jun 2021 - 159 - 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 merge requests.
"Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks." - pre-commit.com
"Developers spend a fair chunk of time during their development flow fixing relatively trivial problems in their code. pre-commit.ci both enforces that these issues are discovered, which is opt in for each developer workflow via pre-commit, but also fixes the issues automatically, letting developers focus their time on more valuable problems." - A user of pre-commit.ci
Links:
pre-commitpre-commit supported hookspre-commit.ciFri, 11 Jun 2021 - 158 - 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 Enforcementpyflakespycodestylemccabepyflakes/messages.pyflake8 Error / Violation Codeswemake-python-styleguideflake8-typing-importstox automation projectNoxpre-commitThu, 03 Jun 2021 - 157 - 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 #1:
- What's the most important thing that it doesn't do yet?
Links:
The Four QuestionsFri, 28 May 2021 - 156 - 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 NewsMotoTest & Code 103: Django - Lacey Williams HenschelModel Bakery: Smart fixtures for better tests FakerFri, 21 May 2021 - 155 - 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 PythonWhy Playwright?playwright-pytestThu, 13 May 2021 - 154 - 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-srcpathsPython Packaging User Guidepypa/packaging: Core utilities for Python packagesflit and requires-pythonExtending and Embedding the Python Interpreter — Python 3.9.2 documentationFlitsetuptoolsPEP 518 -- Specifying Minimum Build System Requirements for Python Projects | Python.orgPEP 517 -- A build-system independent format for source trees | Python.orgFlit editable installs with --symlink or --pth-filePEP 440 -- Version Identification and Dependency Specification | Python.orgSpecifying requires-python with flitwheelUniversal 1 binaryUniversal 2 binaryCython: C-Extensions for PythonCFFIpybind11: Seamless operability between C++11 and PythonCondaconda environmentsconda-forgeVaultsOfParnassusThu, 06 May 2021 - 153 - 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) YOUR LAMP IS NOW ON. YOU ARE IN A DEBRIS ROOM FILLED WITH STUFF WASHED IN FROM THE SURFACE. A LOW WIDE PASSAGE WITH COBBLES BECOMES PLUGGED WITH MUD AND DEBRIS HERE, BUT AN AWKWARD CANYON LEADS UPWARD AND WEST. A NOTE ON THE WALL SAYS ...What's happening is that I'm playing adventure, which you can pip install thanks to Brandon Rohdes. Adventure is a faithful port to Python 3 from the original 1977 FORTRAN code by Crowther and Woods that lets you explore Colossal Cave, where others have found fortunes in treasure and gold, ...
In this episode, we talk with Brandon Rhodes about this marvelous game.
Links:
adventure · PyPIpython-adventure: Original Colossal Caves adventure game, but in Python 3Brandon Rhodes Personal SitePython Design Patternspyephem: Scientific-grade astronomy routines for Pythonpython-skyfield: Elegant astronomy for PythonAdventure in Python 3 - announcement blog post from 2012NetHackFTL: Faster Than LightPEP 517 -- A build-system independent format for source trees | Python.orgTue, 27 Apr 2021 - 152 - 150: A Practical Testing StrategyThu, 15 Apr 2021
- 151 - 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 PythonCorey: But... I don't test my code, "crappy Python" is all I write, and I'd feel like a giant imposter. So yeah, I'd be game. linkSo here we are.This diagram is referenced in the show, the Last Week In AWS Newsletter Production Pipeline.
Special Guest: Corey Quinn.
Links:
Last Week in AWSTue, 30 Mar 2021 - 150 - 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 coverageSpecifying source files — Coverage.py documentationTesting & Packaging - HynekackFri, 12 Mar 2021 - 149 - 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__': # pragma: no cover main() ## test code # To test: # pip install pytest # pytest script.py # To test with coverage: # put this file (script.py) in a directory by itself, say foo # then from the parent directory of foo: # pip install pytest-cov # pytest --cov=foo foo/script.py # To show missing lines # pytest --cov=foo --cov-report=term-missing foo/script.py def test_foo(): assert foo() == 5 def test_main(capsys): main() captured = capsys.readouterr() assert captured.out == "5\n"Suggestion by @cfbolz if you need to import pytest:
if __name__ == '__main__': # pragma: no cover main() else: import pytestFri, 05 Mar 2021 - 148 - 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 and running smoothly.We talk about:
Postmanngroksitemap link testingscripts for manual processesusing failover servers during maintenance, redeployments, etcgitHub webhooks and scripts to between fail over servers and production during deployments automaticallyfloating IP addresses services to monitor your site: StatusCake, BetterUptimethe affect of monitoring on analyticscrash reporting: Rollbar, Sentryresponse timesload testing: LocusLinks:
Python Bytes PodcastTalk Python To Me PodcastTalk Python TrainingPostmanngrokStatusCakeBetter UptimeRollbarSentryLocust12 requests per second in PythonSun, 28 Feb 2021 - 147 - 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 philosophyunit testing and what a unit isTDDwhere Michael's towel is, and what colorMicheal 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 docsMocks Aren't Stubs - Martin Fowlerpytest-mockmock.patchAutospeccingArrange Act Asserttesting-in-python mailing listClassical and Mockist Testing — Classical and Mockist Testing Test First Programming / Test First Developmentepisode 102: Cosmic Python, TDD, testing and external dependencies - Harry Percivalepisode 132: mocking in Python - Anna-Lena Popkespytestunittest - Python docspytest assert usage30 best practices for software development and testing | Opensource.comThu, 18 Feb 2021 - 146 - 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?Sometimes it's hard to know how to test something.Maybe people should learn to test alongside learning how to code.A desire for a resource of testing concepts for non-CS people.Are the testing needs and testing information needs different in different disciplines? Biology, Physics, Astrophysics, etc. Do they have different testing needs?Do we need a "how to test" resource for each?Special Guest: Martin Héroux.
Links:
Joy Division Album Coverepisode 140: Testing in Scientific Research and Academia - Martin Héroux — Martin's previous episode.Fri, 12 Feb 2021 - 145 - 143: pytest markers - Anthony Sottile
Completely nerding out about pytest markers with Anthony Sottile.
Some of what we talk about:
Running a subset of tests with markers.Using marker expressions with and, or, not, and parentheses.Keyword expressions also can use and, or, not, and parentheses.Markers and pytest functionality that use mark, such as parametrize, skipif, etc.Accessing markers with itermarkers and get_closest_marker through item.Passing values, metadata through markers to fixtures or hook functions.Links:
Registering markersslow marker example in pytest documentation — Control skipping of tests according to command line optionpytest-repeat · PyPIsource code for pytest-repeatWorking with custom markers — pytest documentationUsing -k expr to select tests based on their nameMarker revamp and iteration, Historical Notes — pytest documentationSun, 07 Feb 2021 - 144 - 142: MongoDB - Mark Smith
MongoDB is possibly the most recognizable NoSQL document database.
Mark Smith, a developer advocate for MongoDB, answers my many questions about MongoDB.
We cover some basics, but also discuss some advanced features that I never knew about before this conversation.Special Guest: Mark Smith.
Links:
MongoDBEverything You Know About MongoDB is Wrong!Implementing Event Sourcing and CQRS pattern with MongoDBMon, 25 Jan 2021 - 143 - 141: Visual Testing - Angie Jones
Visual Testing has come a long way from the early days of x,y mouse clicks and pixel comparisons. Angie Jones joins the show to discuss how modern visual testing tools work and how to incorporate visual testing into a complete testing strategy.
Some of the discussion:
Classes of visual testing: problems with pixel to pixel testingDOM comparisons, css, html, etc.AI driven picture level testing, where failures look into the DOM to help describe the problem. Where visual testing fits into a test strategy.Combining "does this look right" visual testing with other test workflows."A picture is worth a thousand assertions" - functional assertions built into visual testing.Baselining pictures in the test workflow.Also discussed:
automation engineerTest Automation UniversityLinks:
Test Automation UniversityWed, 30 Dec 2020 - 142 - 140: Testing in Scientific Research and Academia - Martin Héroux
Scientists learn programming as they need it.
Some of them learn it in college, but even if they do, that's not their focus.
It's not surprising that sharing the software used for scientific research and papers is spotty, at best.
And what about testing?
We'd hope that the software behind scientific research is tested.
But why would we expect that?
We're lucky if CS students get a class or two that even mentions automated tests.
Why would we expect other scientists to just know how to test their code?Martin works in research and this discussion is about software and testing in scientific research and academia.
Special Guest: Martin Héroux.Links:
Python Testing with pytest: Simple, Rapid, Effective, and ScalableTest Driven Development: By ExampleMy reaction to "Is TDD Dead?" - Python TestingMartinHeroux/pliffy: Plotting differences with PythonPyBites Code ChallengesPython MorselsMartin Héroux (@martin_heroux) / TwitterScientifically SoundMartin Héroux - Google Scholarspike2py · PyPIpytest-mpl · PyPIFri, 18 Dec 2020 - 141 - 139: Test Automation: Shifting Testing Throughout the Software Lifecycle - Nalin Parbhu
Talking with Nalin Parbhu about the software evolution towards more test automation and the creation of Infuse and useMango.
We talk a software development and "shift left" where automated tests and quality checks have moved earlier into the software lifecycle.
Software approaches and where quality fits inShift leftTest automationRoles of software developers, SDETs (software development engineer in test), testers, QA, etc.Developers doing testing and devopsAutomated testing vs manual testingRegression testing, UI testing, black bock testingUnit testing, white box, API, end to end testingUser acceptance testing (UAT)Mullet Methodology (Agile at the front, Waterfall at the back)Waterwheel Methodology (Requirements -> iterative development -> QA)What's an agile team?Developer resistance to testingManifesto for agile software developmentIterative developmentAdapting to changeAgility: being able to change course quicklySpecial Guests: Nalin Parbhu and Ola Omiyale.
Fri, 04 Dec 2020 - 140 - 138: Mutation Testing in Python with mutmut - Anders Hovmöller
Your test suite tells you about the quality of your code under test.
Mutation testing is a way to tell you about the quality of your test suite.
Anders Hovmöller wrote mutmut for mutation testing in Python, and can be used with pytest, unittest, and others.
In this episode, Anders explains mutation testing, how mutation testing with mutmut works, and good workflows.
Special Guest: Anders Hovmöller.Links:
mutmut · PyPIcosmic-ray · PyPIMutPy · PyPIparso · PyPImutmut documentationNed Batchelder article on mutmutThu, 19 Nov 2020
Podcasts similares a Test & Code
El Partidazo de COPE COPE
Herrera en COPE COPE
La Linterna COPE
Es la Mañana de Federico esRadio
La noche de Cuesta esRadio
La Trinchera de Llamas esRadio
Hondelatte Raconte Europe 1
Affaires sensibles France Inter
LEGEND Guillaume Pley
El colegio invisible OndaCero
La Rosa de los Vientos OndaCero
Les grands dossiers de l'Histoire par Franck Ferrand Radio Classique
Espacio en blanco Radio Nacional
Entrez dans l'Histoire RTL
Le grand récit RTL
Les Grosses Têtes RTL
L'Heure Du Crime RTL
Parlons-nous RTL
El Larguero SER Podcast
Nadie Sabe Nada SER Podcast
SER Historia SER Podcast
Todo Concostrina SER Podcast
Un Libro Una Hora SER Podcast
HISTORIAS DE LA HISTORIA VIVA RADIO
