pytest-docker icon indicating copy to clipboard operation
pytest-docker copied to clipboard

Add docker_compose_subprocess_kwargs fixture support

Open Toilal opened this issue 7 years ago • 5 comments

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': '..'}

Toilal avatar Jan 29 '19 11:01 Toilal

Can you justify why do you need this?

butla avatar Jan 29 '19 19:01 butla

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

Toilal avatar Jan 29 '19 21:01 Toilal

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?

butla avatar Jan 29 '19 21:01 butla

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

Toilal avatar Jan 29 '19 21:01 Toilal

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

augi avatar Jan 25 '24 10:01 augi