Can't run test to django application on Docker with pytest

I am developing django application with PyCharm and trying to test application with pytest, but tests don't run.

Application works on Docker(Docker Compose), consisted of three containers with nginx--web(python3.6.5)--postgresql, and I use testing framework of pytest.

 

I added configuration

Run/Debug Configurations > "+" > Python tests > pytest

and set below

 

 I tryied to run, then error is shown on console

 

```

Testing started at 10:51 ...


/usr/local/bin/docker-compose -f (/path/to/docker-compose.yml) -f /Users/(user_name)/Library/Caches/PyCharm2019.1/tmp/docker-compose.override.42.yml up --exit-code-from web --abort-on-container-exit web
postgres is up-to-date
Recreating web ...
Attaching to web
web | Launching pytest with arguments (/path/to/test.py) in /opt/project
web |
web | re-exec with libfaketime dependencies
web | usage: _jb_pytest_runner.py [-h] [--path PATH] [--target TARGET]
web | _jb_pytest_runner.py: error: unrecognized arguments: (/path/to/test.py)
web exited with code 2
Aborting on container exit...

Process finished with exit code 2

Empty suite


```

It looks PyCharm couldn't pass pytest command properly to web container, but i can't be sure.

 

Anyone have idea to help me?

 

Please tell me if any information is sufficient.

 

Adding:

testing with pytest inside web conteiner can run.

1 comment
Comment actions Permalink

Hi,

Will it be possible for you to reproduce the issue in a minimal project and upload it for us so that we can reproduce locally?

0

Please sign in to leave a comment.