bibektimilsina00 / FastAPI-PgStarterKit

FastAPI + PostgreSQL Starter Kit: A streamlined template for building backends with FastAPI, PostgreSQL, and Docker.
18 stars 1 forks source link

Running pytest #1

Open laurent101 opened 1 week ago

laurent101 commented 1 week ago

Hello,

I took your updated project for a spin. Docker containers built successfully and migrations performed as expected. However, when running pytest, only part of the tests pass, with those in api/routes/test_users.py failing due to authorization issues. It would be helpful if you could let users of your project know how to successfully run pytest. Thank you

bibektimilsina00 commented 2 days ago

Thank you for the issue i will take a look asap.

laurent101 commented 14 hours ago

Further digging showed that all tests are actually fine, but that the issue is (oddly enough) related to the scope of fixtures for normal and super-users. I had to separate users into normal user and superuser modules, after which pytest ran successfully.