Just a suite of approaches which I find useful.
Run database schema migrations:
alembic upgrade head
Generate secret key:
tr -dc 'a-z0-9!@#$%^&*(-_=+)' < /dev/urandom | head -c50
Generate RSA private/public key pair:
openssl genrsa -out private_key_file.pem 4096
openssl rsa -in private_key_file.pem -outform PEM -pubout -out public_key_file.pem
- Install poetry
- Install project dependencies (run in the root directory):
poetry install
- Set following environment variables (use
.env
file):export PYTHONPATH=src # optional: export TEST_DATABASE_URL=postgresql://postgres:password@localhost:port/test_db_name
- Run tests:
or
poetry run pytest
poetry shell pytest