This Pytest plugin allows you to easily define data-driven fixtures based on external files. It supports `JSON`, `CSV`, and `XML` data sources, and can automatically instantiate Python classes or functions using this data.
Project description
Pytest Fingest Fixture Plugin
This Pytest plugin allows you to easily define data-driven fixtures based on external files. It supports JSON, CSV, and XML data sources, and can automatically instantiate Python classes or functions using this data.
Features
- Automatic registration of data-backed fixtures
- Supports JSON, CSV, and XML file formats
- Optional descriptions for improved debugging
- Configurable base data path via
pytest.ini
Installation
Place the plugin code inside your project (e.g. in conftest.py) or install it as a standalone plugin.
Configuration
Add the following to your pytest.ini:
[pytest]
fingest_fixture_path = data # Base directory for fixture data files
Example JSON
from plugin import data_fixture
@data_fixture("users.json", description="Example user list")
class UserData:
def __init__(self, data):
self.users = data
def test_user_count(UserData):
assert len(UserData.users) > 0
Example CSV
@data_fixture("products.csv", description="Product list")
def product_list(data):
return [p for p in data if p["available"] == "true"]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fingest-0.0.2.tar.gz.
File metadata
- Download URL: fingest-0.0.2.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.12.33+deb13-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2240b887f20ae36a163f1d298f74bbc18112bcc351bac199fba47d47789ef17e
|
|
| MD5 |
556571f3fdc738ddac6ddfa9307c70f2
|
|
| BLAKE2b-256 |
3f7fcb1498c5efecad9445021b23a30afb7b96610e9d19cf184bbde1f53bd7cc
|
File details
Details for the file fingest-0.0.2-py3-none-any.whl.
File metadata
- Download URL: fingest-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.12.33+deb13-amd64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59f7f17b1fd0c44a397f3bfd666357f5b1386b711f3e91e4611bd260d5c62db4
|
|
| MD5 |
c790171084feef98f9f7336255540024
|
|
| BLAKE2b-256 |
f23a764002c3784a48ff4a4db53c69bae996e3e1ab5163e05f6761a80a6861aa
|