
149 episodes

Test & Code : Python Testing Brian Okken
-
- Technology
-
-
4.6 • 55 Ratings
-
Test & Code is a weekly podcast hosted by Brian Okken.
The show covers a wide array of topics including software engineering, development, testing, Python programming, and many related topics.
When we get into the implementation specifics, that's usually Python, such as Python packaging, tox, pytest, and unittest. However, well over half of the topics are language agnostic, such as data science, DevOps, TDD, public speaking, mentoring, feature testing, NoSQL databases, end to end testing, automation, continuous integration, development methods, Selenium, the testing pyramid, and DevOps.
-
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.
Special Guest: Corey Quinn.
Sponsored By:
PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE21Support Test & Code : Python Testing
Links:
Last Week in AWS -
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.
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.Support Test & Code : Python Testing
Links:
episode 147: Testing Single File Python Applications/Scripts with pytest and coverageSpecifying source files — Coverage.py documentationTesting & Packaging - Hynekack -
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 pytest
Sponsored By:
PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE21Support Test & Code : Python Testing -
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:
Postman
ngrok
sitemap link testing
scripts for manual processes
using failover servers during maintenance, redeployments, etc
gitHub webhooks and scripts to between fail over servers and production during deployments automatically
floating IP addresses
services to monitor your site: StatusCake, BetterUptime
the affect of monitoring on analytics
crash reporting: Rollbar, Sentry
response times
load testing: Locus
Special Guest: Michael Kennedy.
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.Support Test & Code : Python Testing
Links:
Python Bytes PodcastTalk Python To Me PodcastTalk Python TrainingPostmanngrokStatusCakeBetter UptimeRollbarSentryLocust12 requests per second in Python -
For Those About to Mock - Michael Foord
A discussion about mocking in Python with the original contributor of unittest.mock, Michael Foord.
Of course we discuss mocking and unittest.mock.
We also discuss:
testing philosophy
unit testing and what a unit is
TDD
where Michael's towel is, and what color
Micheal was instrumental in the building of testing tools for Python, and continues to be a pragmatic source of honest testing philosopy in a field that has a lot of contradictory information.
Special Guest: Michael Foord.
Sponsored By:
PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE21Support Test & Code : Python Testing
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 -
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.
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.Support Test & Code : Python Testing
Links:
Joy Division Album Coverepisode 140: Testing in Scientific Research and Academia - Martin Héroux — Martin's previous episode.
Customer Reviews
A must listen for software testing
This podcast has directly impacted how we test our code. I learn something new each episode. Talk Python to me in conjunction with Test and Code and Python Bytes has exponentially increased my productivity and learning. Thank you!
Testing, code and more
This show provides what it says on the label: engaging discusisons about testing and code. Host Brian Okken approaches each episode with a perfect blend of passion, knowledge and humility. Great stuff!
In depth on a topic that deserves it
As a junior Python developer, I recently had a sudden realization that testing skills and TDD could be the missing component of my workflow. Learning through examples online works, but testing in the real world is a precarious topic! This podcast is no less than what this topic deserves.
Top Podcasts In Technology
Listeners Also Subscribed To





