Skip to content

Commit 4dc8d44

Browse files
committed
Use --wait in the default setup command
1 parent 5c982af commit 4dc8d44

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ def test_status_code(http_service):
9494
assert response.status_code == status
9595
```
9696
97+
> The default `docker_setup` command includes `--wait`, which respects either the
98+
> image `HEALTHCHECK` or the compose `healthcheck`. Generally, if those
99+
> are configured properly, `wait_until_responsive` should not be required.
100+
97101
By default, this plugin will try to open `docker-compose.yml` in your
98102
`tests` directory. If you need to use a custom location, override the
99103
`docker_compose_file` fixture inside your `conftest.py` file:
@@ -138,7 +142,7 @@ def docker_compose_project_name() -> str:
138142
# Stop the stack before starting a new one
139143
@pytest.fixture(scope="session")
140144
def docker_setup():
141-
return ["down -v", "up --build -d"]
145+
return ["down -v", "up --build --wait"]
142146
```
143147

144148

src/pytest_docker/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def docker_cleanup() -> Union[List[str], str]:
179179

180180

181181
def get_setup_command() -> Union[List[str], str]:
182-
return ["up --build -d"]
182+
return ["up --build --wait"]
183183

184184

185185
@pytest.fixture(scope=containers_scope)

0 commit comments

Comments
 (0)