Programming My Life - python
  1. Mocking in Python tests

    For a while now, I've felt unsure about mocking in Python. It has helped me test in the past, but I've also seen a lot of smart people talk or write about its pitfalls.

    Recently, I had to test some functionality around calls to Twilio, so I decided to investigate …

  2. [TIL] Mocking Chained Calls

    At work last week, I was asked to write tests for code that reaches out to Twilio's verify service. Here is what that code looks like (from the Twilio docs):

    client = Client(account_sid, auth_token)
    
    verification = client.verify \
                         .v2 \
                         .services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                         .verifications \
                         .create(to='+15017122661', channel='sms')
    

    I was able to …

  3. Strategies for a Long Running Side Project

    At DjangoConUS 2023, I gave a lighting talk with this title. It was a lot of fun, and I'd suggest you try to give a lightning talk if you haven't before. It's a great way to try giving a talk at a conference without having to commit to a full …