LTMullineux / fastapi-snippets

A selection of snippets to make working with FastAPI a dream
35 stars 3 forks source link

`00-ultimate-fastapi-project-setup` doesn't work with current versions of dependencies #2

Closed hazadus closed 3 weeks ago

hazadus commented 4 months ago

Hello!

Thanks for great article, and the template looks VERY good. Unfortunately, I can't run it with current versions of dependencies. I tried and fixed some errors, but something seems very off with pytest-asyncio... Can you suggest how to migrate the code to current version of pytest-asyncio?

qbicsky commented 2 months ago

@hazadus , what errors do you get from pytest?

Generally this boilerplate is a little bit behind new versions of pytest, pydantic, etc.

Pytest made - probably unintentionally - a breaking changes in version 0.23.

First of all using custom event_loop has been deprecated. The second thing is that engine fixture scoped to class would give you an error. Moving from class to function (which is default for engine) would resolve this issue. But I remember that several issues raised in pytest part of this boilerplate - hence my question at the beginning.

LTMullineux commented 1 month ago

Hi @hazadus pushed some changes that should fix this, the requirements were not pinned (my fault)

hazadus commented 1 month ago

Hi @hazadus pushed some changes that should fix this, the requirements were not pinned (my fault)

Thanks! Already figured out how to solve my problems, but these changes will be helpful to other users!