Skip to content

Commit d8939c8

Browse files
docs: how to use multiple compose files (#113)
1 parent 0651ad6 commit d8939c8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ def docker_compose_file(pytestconfig):
108108
return os.path.join(str(pytestconfig.rootdir), "mycustomdir", "docker-compose.yml")
109109
```
110110

111+
To use [multiple compose files](https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/),
112+
return a list of paths from the `docker_compose_file` fixture:
113+
114+
```python
115+
import os
116+
import pytest
117+
118+
119+
@pytest.fixture(scope="session")
120+
def docker_compose_file(pytestconfig):
121+
return [
122+
os.path.join(str(pytestconfig.rootdir), "tests", "compose.yml"),
123+
os.path.join(str(pytestconfig.rootdir), "tests", "compose.override.yml"),
124+
]
125+
```
126+
111127
## Available fixtures
112128

113129
By default the scope of the fixtures are `session` but can be changed with

0 commit comments

Comments
 (0)