Skip to main content

Fuisce

Database management and testing for SQLAlchemy-based Flask apps.

Why Fuisce?

Fuisce, or whiskey in Irish, is probably not going to grant you eternal life... but it may extend the longevity of your SQLAlchemy-based Flask app. The package is designed to be a lightweight addition to any application, performing some of the database setup operations while coordinating database management for robust test suites.

For example, the current edition of the Flask documentation suggests creating a temporary SQLite database for each test. This is perfectly fine for simple applications, but adds substantial overhead (and test time) to applications with many tests, especially those if it is desirable to have that database contain some preloaded information. Instead, it would be preferable to create and use one temporary database instance for the majority of tests that only require read-access to the database, and then only create additional test databases for the tests that modify the state of the database (e.g., SQLAlchemy transactions).1 Fuisce provides the infrastructure to create databases in both of these cases: a "persistent" database for read-only tests, and "ephemeral" databases for each transaction). The persistent test database is used by default, but a transaction_lifetime decorator can be used to indicate that a given test should use an ephemeral copy.

Installation

Fuisce is registered on the Python Package Index (PyPI) for easy installation. To install the package, simply run

pip install fuisce

The package requires a recent version of Python (3.9+).

Usage

For an up-to-date API reference, build and read the docs:

make docs
# open `docs/build/html/index.html` in your browser

More details on using the Fuisce package are forthcoming...

License

This project is licensed under the GNU General Public License, Version 3. It is fully open-source, and while you are more than welcome to fork, add, modify, etc. it is required that you keep any distributed changes and additions open-source.

Changes

Changes between versions are tracked in the changelog.

  1. Yes, you could also just not create databases and mock the database return functions, but my experience has been that it is even more tedious to maintain a comprehensive set of mocked data to test various intricacies and edge cases while simultaneously ensuring that the mocks behave similarly enough to SQLAlchemy objects.

Release files for fuisce 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fuisce 1.0.2
File Size Uploaded
fuisce-1.0.2.tar.gz 25.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fuisce 1.0.2
File Interpreter ABI Platform
fuisce-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 47.2 kB

Release files / fuisce-1.0.2.tar.gz

Download URL fuisce-1.0.2.tar.gz
Size 25.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce21d0444233c636a18254f5c3a6665090a282d89e7e8c2e253b3af0256f0ed0
BLAKE2b-256 checksum
How to use checksums
e8da8ef3825de22e51f9d68f3e336872e369452a9d1ed06ddc74b26fa1c5b377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release files / fuisce-1.0.2-py3-none-any.whl

Download URL fuisce-1.0.2-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfa3191d9cdc910ae4d19ea5c44cfb3d09a499da1dfe05cb072c7284cb84a959
BLAKE2b-256 checksum
How to use checksums
f43e4a76e3e98ca642415a980030f74dbf34c96f6e80dbd0f7e44cf479024494
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.24.1

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page