python

  • 20th November 2023

SQLAlchemy, OnUpdate & Datetime UTCNOW deprecation in 3.12

This is a quick post about migrating your utcnow() to now(tz=UTC) in SQLAlchemy for your onupdate function argument to your SQL Models. …

Read more 
  • 4th October 2023

Big Uploads and Checksum Validation

Ever wanted to upload big files without storing them in memory as they are being written with FastAPI? …

Read more 
  • 2nd August 2023

Mocking the Post Method on an Async HTTPX Post Request

A quick snippet for mocking HTTP requests with an the async httpx context manager. async with httpx.AsyncClient() as client: signup_response = await client.post( f"https://{AUTH0_DOMAIN}/api/v2/users", data=signup_request_body, headers=signup_request_headers, timeout=30, ) …

Read more 
  • 16th February 2023

Testing in the Terminal

Find yourself running a pytest command repeatedly trying to work out what a problem is and getting sick of clicking back on the terminal window where the output is and pressing arrow up to re-run the test? Or even running tests in an IDE and sick of re-running the test time after time with your mouse? …

Read more