pytest-flask-sqlalchemy icon indicating copy to clipboard operation
pytest-flask-sqlalchemy copied to clipboard

Running with FastAPI

Open gustavonmartins opened this issue 3 years ago • 1 comments

Helllo,

I actually use FastAPI instead of Flask and didn't find anything similar to your lib for FastAPI. Looking at your source code, although I see a requirement for Flask on setup.py, I see no real use of it along the implementation files.

Does this mean I can use this with FastAPI?

In case not, I have the following question:

  • What are the changes needed to do it?
  • Do you plan to do it or are you open to let somebody do it?

Thank you so much!

gustavonmartins avatar Apr 07 '21 14:04 gustavonmartins

I adapted the db fixture code to work with SQLAlchemy here: https://github.com/compute-tooling/compute-studio/blob/fa1b4ede696b12b5676e277b80dce1ec16c44a59/workers/cs_workers/services/api/tests/conftest.py#L28-L81

As you can see there are some things there like handling migrations and clearing tables, etc. after the test finishes that I haven't done. Maybe this will give you a place to start.

hdoupe avatar Jun 12 '21 21:06 hdoupe