topsport-com-au / starlite-saqlalchemy

Starlite API boilerplate abstraction and utilities.
https://topsport-com-au.github.io/starlite-saqlalchemy/
MIT License
31 stars 8 forks source link

Can pytest fixtures be distributed? #106

Closed peterschutt closed 1 year ago

peterschutt commented 2 years ago

Fixtures such as the integration test client, and the caplog fixture would be of benefit downstream if there was a way to make them available.

gazorby commented 1 year ago

Maybe by writing a pytest plugin?

I think it should be a matter of adding a starlite_saqlalchemy.testing.pytest module and updating pyproject.toml:

[tool.poetry.plugins."pytest11"]
"starlite_salqalchemy" = "starlite_saqlalchemy.testing.pytest"

Then fixtures in testing.pytest should be available downstream.

peterschutt commented 1 year ago

Yes, plugin most likely the way forward!

There's also a series of things that I need to monkeypatch for testing every application that would be great to be able to be lifted into the lib here somehow. But that is probably a separate issue, and I'll open that after I finish off a refresh of example-starlite-saqlalchemy that I'm working on.