Skip to main content

Database testing toolkit integrating Postgres, SQLAlchemy, Pytest and Docker

Project description

[!WARNING]
Alpha-level software.

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.0a2.tar.gz (10.8 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.0a2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: elefast-0.1.0a2.tar.gz
  • Upload date:
  • Size: 10.8 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.0a2.tar.gz
Algorithm Hash digest
SHA256 68b489e81e7ee2fb89e71c41f95c7993006636285396ad11ffca6e996fafde52
MD5 9263857e27b1363cd728e4f513155726
BLAKE2b-256 f1891816ffba44ba4c016b1e0763b4a63746b8c473791eefd96773cf196a1f82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: elefast-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 15.3 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.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 59ba799ece29ecb75aea1711c3cd86a80a5fe7a324b6f71f5706d0dfc9634843
MD5 7f92caa8683208d3015b37e1b0b7e522
BLAKE2b-256 582f5534eaf3435728330cbd3e0e2d12a81067d74201a7dff77b1efc8dc374f2

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