James Bennett<p>I have a <a href="https://infosec.exchange/tags/Python" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>Python</span></a> codebase using <a href="https://infosec.exchange/tags/sqlalchemy" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>sqlalchemy</span></a> Core -- *NOT* ORM -- for its data layer, and I'm currently not happy with the way it's doing data for testing. Who has a pattern for this that they actually like?</p><p>I already have ephemeral per-test-function isolation of the database, so that's taken care of.</p><p>If this were ORM I'd just use something like factory-boy, but the fact that it's Core and doesn't really map neatly to objects the way ORM stuff does rules that out. I think ideally what I'd like is some sort of declarative JSON file format or whatever that lets me provide a mapping of table names to lists of rows to insert into them, and then a pytest fixture that lets me say "load that JSON file for this test". Has anyone written something like that? Do I get to go write my own?</p>