avast / pytest-docker

Docker-based integration tests
MIT License
427 stars 71 forks source link

Add docker_compose_subprocess_kwargs fixture support #37

Open Toilal opened 5 years ago

Toilal commented 5 years ago

This allow custom options be passed to underlying subprocess.check_output invocations, like cwd.

@pytest.fixture(scope='session') def docker_compose_subprocess_kwargs(): return {'cwd': '..'}

butla commented 5 years ago

Can you justify why do you need this?

Toilal commented 5 years ago

Python sources are lying in a src subdirectory, so pytest runs from this directory. but docker-compose.yml and .env file are in the root directory of the repository, so I need to pass cwd parameter to execute docker-compose (cwd='..').

https://github.com/GIP-Recia/ESCOSynchroMoodle

butla commented 5 years ago

Ok.

As I don't know when this'll be merged, maybe you can work around it by overwriting docker_compose_file and maybe changing the paths in your compose files?

Toilal commented 5 years ago

Thx. I actually use a fork installed with pip right from github, with both submitted pull requests.

augi commented 10 months ago

May I ask you to resolve the conflicts? 🙏 Thanks!