How to generate python test fixture data from excel for fastapi unit tests
- Step 1Maintain test data in Excel — Add your test cases as rows with column headers matching the fields your FastAPI endpoint expects.
- Step 2Generate the Python fixture — Upload and select list_of_dicts mode. The generated code is shown in the preview.
- Step 3Import into your test file — Download as data.py and import: from data import test_cases. Use with @pytest.mark.parametrize.
Frequently asked questions
Can I use this with pytest's fixture decorator?+
Yes. Assign the list to a variable and use it in a @pytest.fixture returning the list, or directly in @pytest.mark.parametrize.
How many test rows are included?+
Up to 500 rows are inlined. Add a note in the Excel for any rows over 500 — those require pandas.read_excel() for full dataset processing.
Does it generate Pydantic model instances?+
Not directly — the output is plain dicts. Pass each dict to your Pydantic model constructor: MyModel(**row) in your test.
Privacy first
Every JAD Excel tool runs entirely in your browser using SheetJS and ExcelJS. Your spreadsheets, formulas, and data never leave your device — verified by zero outbound network requests during processing.