Skip to content

A simple demo that shows one approach at how to build and test Python apps that use async features with Postgres database storage.

License

Notifications You must be signed in to change notification settings

ralphqq/testing-async-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testing-async-db

A simple demo that shows one approach at how to build and test apps that use async features with Postgres database storage.

Requirements

Please see requirements.txt for full list of dependencies.

Setup

  1. Clone this repo
  2. Create and activate a virtual environment
  3. Install the dependencies:
    $ pip install -r requirements.txt
  4. Create a .env file in the project root and provide values to environment variables (see 'Environment Variables' section below)
  5. Run Postgres docker image:
    $ docker run --rm -p 5432:5432 --env-file .env --name db postgres
  6. Run the test suite:
    $ pytest

Environment Variables

Please create a .env file that defines values for the following environment variables:

  • POSTGRES_USER (name of Postgres user)
  • POSTGRES_PASSWORD (Postgres password)
  • POSTGRES_DB (database name)
  • DB_HOST (host where Postgres is running, usually localhost)

License

This project is available under the MIT License.

About

A simple demo that shows one approach at how to build and test Python apps that use async features with Postgres database storage.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages