Test & Code cover image

Test & Code

Latest episodes

undefined
Sep 14, 2021 • 13min

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.Full TranscriptLinks:Python Testing with pytest — The fastest way to get up to speed on pytest.all pytest flags in pytest 6.2.x
undefined
Aug 20, 2021 • 30min

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.Full TranscriptSpecial 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 format
undefined
Aug 3, 2021 • 23min

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 @brianokken or via the contact form for further questions or if I missed some crucial variant of TDD that you know and love. Full TranscriptSponsored By:PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22Links: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, etc
undefined
Jul 20, 2021 • 19min

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. Full TranscriptLinks: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-Webster
undefined
Jul 8, 2021 • 15min

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. Full TranscriptSponsored By:Datadog: Modern end-to-end monitoring & security. See inside any stack, any app, at any scale, anywhere. Get started with a free trial at testandcode.com/datadog and Datadog will send you a free t-shirt. 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 Overflow
undefined
Jul 2, 2021 • 48min

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 component analysis, clustering Model drift and re-running analysis What kind of tweets perform well And much more Full TranscriptSpecial Guest: Matt Harrison.Sponsored By:PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22Links:Applied Pandas: Twitter Analytics — the coursematt harrison (@__mharrison__) / Twitter — follow for Python, Data Science, & Career AdviceBrian Okken (@brianokken) / Twitter — follow for Python, pytest, Packaging, & Software Engineering Advice
undefined
Jun 18, 2021 • 43min

158: TDD in Swift - Gio

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. Full TranscriptSpecial Guest: Gio Lodi.Sponsored By:Datadog: Modern end-to-end monitoring & security. See inside any stack, any app, at any scale, anywhere. Get started with a free trial at testandcode.com/datadog and Datadog will send you a free t-shirt. Links:TDD in Swift with SwiftUI and Combinemokacoding - Gio's blogXCTestSoftware Design: Tidy First? - Kent Beck on Substack
undefined
Jun 11, 2021 • 42min

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 Full TranscriptSpecial Guest: Anthony Sottile.Sponsored By:PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22ConfigCat.com: Release features faster with less risk with ConfigCat. You can try it out with the forever free plan or get 25% off with code testandcode2021 Promo Code: testandcode2021Links:pre-commitpre-commit supported hookspre-commit.ci
undefined
Jun 3, 2021 • 23min

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. Full TranscriptSpecial Guest: Anthony Sottile.Sponsored By:Datadog: Modern end-to-end monitoring & security. See inside any stack, any app, at any scale, anywhere. Get started with a free trial at testandcode.com/datadog and Datadog will send you a free t-shirt. ConfigCat.com: Release features faster with less risk with ConfigCat. You can try it out with the forever free plan or get 25% off with code testandcode2021 Promo Code: testandcode2021Links:Flake8: Your Tool For Style Guide Enforcementpyflakespycodestylemccabepyflakes/messages.pyflake8 Error / Violation Codeswemake-python-styleguideflake8-typing-importstox automation projectNoxpre-commit
undefined
May 28, 2021 • 23min

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? Full TranscriptSpecial Guest: Tim Ottinger.Sponsored By:PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22ConfigCat.com: Release features faster with less risk with ConfigCat. You can try it out with the forever free plan or get 25% off with code testandcode2021 Promo Code: testandcode2021Links:The Four Questions

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