Hey there!

Welcome to where I share what I've learned over the years. You'll find little tidbits of experience that I have come along through experience. If you find anything that could be improved please let me know.

Importing apps with pytest

Something that I couldn't figure out was how to import my app so that I could test it with pytests. Isolated tests would work, but anytime I tried to import something from my app like so

from app.main import app
from fastapi.testclient import TestClient

client = TestClient(app)

def test_root():
    response =...

Setting up a Postgres Database for Rails (but not necessarily)

This is geared toward debian linux users.

Connecting to Postgres and looking around.

  • Log into your postgres instance with sudo -u postgres psql
  • You should see the psql prompt
~/repos/chorelist$ sudo -u postgres psql
psql (14.6 (Ubuntu 14.6-0ubuntu0.22.04.1))
Type "help" for help.

postgres=#
  • \?: list of possible commands and short descriptions. This should be...

2023-02-06 Update

The last year or so has been bumpy. I changed jobs, twice. Went from Ruby on Rails back to Python. Emerged from a pandemic. Neglected my health a little and learned some things. This is still ongoing, nothing serious though. Saw coworkers get let go, some that even helped me...

"First" Post

If you're reading this it's because I was able to get everything working. I still have some things to fix up, but overall the app is working as expected. I should be able to add in some code examples at some point. To that end...

Welcome!

Factorybot: Creating in Bulk

Often I find that I need to create more than one record for my specs. A simple create(:some_factory, name: 'something1') repeated multiple times seems inefficient and wrong.

create_list: The Alternative

There is a way to create a set of records in one go, but the drawback is that the objects will...

Last updated: 2024-11-12 12:43:23 UTC