s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.94k stars 168 forks source link

Anyone has pytest working with docker-compose ? #205

Closed rcholic closed 6 months ago

rcholic commented 6 months ago

I tried the following, but it does not work and prompt me with help information on command parameters for docker-compose:

docker-compose -f deploy/docker-compose.yml -f deploy/docker-compose.dev.yml --project-directory . run --build --rm api pytest -vv .
s3rius commented 6 months ago

This command is used in tests.

docker-compose -f deploy/docker-compose.yml --project-directory . run --rm api pytest -vv .

So it is proven to be working.

rcholic commented 6 months ago

I figured it out: my docker-compose version was too old (1.2.x). After upgrading it to 2.24.x, it works beautifully! Thanks @s3rius