Open tkl5 opened 4 years ago
It worked for me
Install postgres in the docker image:
RUN apt update && apt install -y postgresql postgresql-contrib
Create a user in the just before to run the tests
RUN useradd -u 8877 testing
USER testing
CMD pytest -s -v
Running tests works in Windows Subsystem for Linux but not in a Docker container. Is my general test layout correct? Looks like it's not able to find
initdb
. In other words, is it having conflict issues with the database created in Docker-compose.yml or does it have anything to do with that?My test file
testMyProject.py
:docker-compose.yml:
I run
docker-compose exec myproject python3 -m unittest
Traceback: