Skip to main content

Database testing toolkit integrating Postgres, SQLAlchemy, Pytest and Docker

Project description

Elefast 🐘⚡

Using an actual database for testing is nice, but setting everything up can be a pain. Generating the schema, isolating the state, and supporting parallel execution while keeping everything reasonably quick. Elefast helps you by providing utilities for all of these tasks

To learn more, visit the documentation or run through the quickstart guide below.

Quickstart

Install the package from PyPi through your package manager

uv add 'elefast[docker]'

add the recommended set of fixtures to your conftest.py

mkdir tests/ && uv run elefast init >> tests/conftest.py

create a test using your new set of fixtures

from sqlalchemy import Connection, text

def test_database_math(db_connection: Connection):
    result = db_connection.execute(text("SELECT 1 + 1")).scalar_one()
    assert result == 2

When you now run pytest, we'll automatically start a Docker container (if one is not already running), and pass a database connection into the test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

elefast-0.1.0a3.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elefast-0.1.0a3-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file elefast-0.1.0a3.tar.gz.

File metadata

  • Download URL: elefast-0.1.0a3.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for elefast-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 ff7de5459702bcfc5d03951d30d4140efd9fe90ec320377f662419907f85bf88
MD5 c3d268f84eb0be5cdf74890515204f3d
BLAKE2b-256 2179258d84df57c558a09845118cd55422c87cc034000d9bc238eb900f28b1ee

See more details on using hashes here.

File details

Details for the file elefast-0.1.0a3-py3-none-any.whl.

File metadata

  • Download URL: elefast-0.1.0a3-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for elefast-0.1.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed006bf930654bc166b1b6f5b19f4c6bd5a3af81333bbaba1e2528cd9034dce
MD5 fceaa670f2ee00e55afbb7c403a3e03d
BLAKE2b-256 b15eac4bc3268a332642883129b6a9debbe4bde1649b37ca56c6d5fdaf777c84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page