Test & Code cover image

Test & Code

Latest episodes

undefined
May 14, 2021 • 32min

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-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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
May 7, 2021 • 50min

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-forgeVaultsOfParnassus 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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Apr 28, 2021 • 56min

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.org 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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Apr 15, 2021 • 11min

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 with Projects has lots of "when you need it" sections like debugging failed tests, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Mar 31, 2021 • 50min

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'd be game. link So here we are. This diagram is referenced in the show, the Last Week In AWS Newsletter Production Pipeline. Full TranscriptSpecial Guest: Corey Quinn.Sponsored By:PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22Links:Last Week in AWS ★ Support this podcast on Patreon ★
undefined
Mar 12, 2021 • 14min

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 - Hynekack 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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Mar 6, 2021 • 12min

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.pydef 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 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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Feb 28, 2021 • 48min

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 Python 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, mocking, testing strategy, and CIThen pytest Booster Rockets can help with advanced parametrization and building plugins.Whether you need to get started with pytest today, or want to power up your pytest skills, PythonTest has a course for you. ★ Support this podcast on Patreon ★
undefined
Feb 18, 2021 • 49min

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.com ★ Support this podcast on Patreon ★
undefined
Feb 13, 2021 • 54min

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? Full TranscriptSpecial Guest: Martin Héroux.Sponsored By:Linode: If it runs on Linux, it runs on Linode. Get started on Linode today with $100 in free credit for listeners of Test & Code.Links:Joy Division Album Coverepisode 140: Testing in Scientific Research and Academia - Martin Héroux — Martin's previous episode. ★ Support this podcast on Patreon ★

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app