Test and Code

Brian Okken

Python's test focused podcast is more than just pytest, testing, and TDD.

  • 12 minutes 2 seconds
    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?


     Learn pytest

    7 September 2024, 4:27 pm
  • 7 minutes 19 seconds
    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.

     Learn pytest

    3 June 2024, 6:23 pm
  • 40 minutes 11 seconds
    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


     Learn pytest

    4 May 2024, 9:54 pm
  • 47 minutes 44 seconds
    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 applications
    • SaaS Pegasus
    • placecard.me
    • What boilerplate projects are
    • Django cookiecutter
    • Cookiecutter
    • Which database to use, probably PostgreSQL
    • Authentication choises, probably Allauth
    • Docker, Docker for development, Docker for deployment
    • Deployment targets / hosting services. Render, Heroku, Fly.io, for PaaS options.
    • Front end frameworks. Bootstrap, Tailwind, DaisyUI, TailwindUI
    • HTMX vs React vs straight Django templates
    • Rockets
    • Font Awesome
    • and of course, SaaS Pegasus

     Learn pytest

    24 April 2024, 12:52 am
  • 27 minutes 31 seconds
    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 testing
    • How much testing is the right about of testing
    • Should code coverage be measured and tracked
    • Good refactoring can reduce code coverage
    • Is it worth testing error conditions?
    • Are rare error codes ok to just monitor?
    • API drift and autospec
    • Mitigating risk
    • Deciding what to test and what not to test
    • Focus 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 workloads
    • Cost of a service breaking vs the cost of creating, maintaining, and running tests
    • Keeping test suites quick to minimize getting distracted


    Links:


     Learn pytest

    18 April 2024, 4:26 am
  • 56 minutes 7 seconds
    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:

    • Podcasting
    • Building new SaaS (software as a service) products
    • Balancing work, side hustle, and family
    • Great places to snowboard in British Columbia

    BTW. This episode was recorded last summer before I switched to transistor.fm.
    I'm now on Transistor for most of a year now, and I love it.

    Links from the show:


     Learn pytest

    11 April 2024, 7:36 am
  • 47 minutes 46 seconds
    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 virtualenv
    • Astral 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:


     Learn pytest

    11 March 2024, 8:12 pm
  • 39 minutes 23 seconds
    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.


     Learn pytest

    25 February 2024, 4:38 pm
  • 38 minutes 25 seconds
    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:


     Learn pytest

    7 February 2024, 5:20 am
  • 13 minutes 22 seconds
    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.  
    There are a few pytest plugins that help with this:

    We talk about each of these in this episode.


     Learn pytest

    19 January 2024, 10:09 pm
  • 7 minutes 31 seconds
    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:


     Learn pytest

    13 January 2024, 7:18 pm
  • More Episodes? Get the App
© MoonFM 2024. All rights reserved.