schireson / pytest-mock-resources

Pytest Fixtures that let you actually test against external resource (Postgres, Mongo, Redshift...) dependent code.
https://pytest-mock-resources.readthedocs.io/en/latest/quickstart.html
MIT License
179 stars 19 forks source link

Dc/session option #71

Closed DanCardin closed 5 years ago

DanCardin commented 5 years ago

Fixes #27

I had originally wanted

pg = create_postgres_fixture()
db = create_session_fixture(pg)

but i couldn't figure out a way of targeting the first fixture name, as pytest bases it's name off the pg name bound in the globals of the module, and has nothing to do with the actual fixture function object.

This seems like a medium compromise.