Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.81 KB

README.md

File metadata and controls

69 lines (53 loc) · 1.81 KB

async_pytest

For DB connection

  1. Install PostgreSQL

You can set your DB host/user/name via pgAdmin

  1. Install requirements via pip or poetry
pip install -r requirements.txt
poetry install
  1. Create .env file in project root dir
  2. Fill environment variables
BD_USER=USER_NAME_FOR_BD
BD_PASS=PASSWORD
BD_HOST=HOST_NAME
BD_PORT=HOST_PORT
BD_NAME=NAME_OF_BD

Step 5 automated with app startup

  1. Run migration script for data population (table creation and data filling)
alembic upgrade head

You can drop table after

alembic downgrade base

Run application locally

fastapi dev application/application.py

U`ll see output like this with clickable URLs:

 ╭────────── FastAPI CLI - Development mode ───────────╮
 │                                                     │
 │  Serving at: http://127.0.0.1:8000                  │
 │                                                     │
 │  API docs: http://127.0.0.1:8000/docs               │
 │                                                     │
 │  Running in development mode, for production use:   │
 │                                                     │
 │  fastapi run                                        │
 │                                                     │
 ╰─────────────────────────────────────────────────────╯

Run tests in /test dir

To Do

  1. add endpoints for inserting/deleting users from DB
  2. add API docs done in v0.4.2 (descriptions to DTO)
  3. async tests with pytest
  4. check all setup ways via requirements and poetry