Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 742 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 742 Bytes

TestClient example

This folder contains an example showing how to test an API using the built-in TestClient and pytest.

The preparation of this example is described in the official documentation under testing. This demo uses SQLite, refer to Piccolo's documentation to use PostgreSQL.

Getting started

  1. Create a Python virtual environment
  2. Activate the virtual environment
  3. Install dependencies in requirements.txt
  4. Run tests using pytest
# create a Python virtual environment
python -m venv venv

# activate
source venv/bin/activate  # (Linux)

venv\Scripts\activate  # (Windows)

# install dependencies
pip install -r requirements.txt

# run tests
pytest