pytest-docker 3.2.3__tar.gz → 3.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytest_docker-3.2.3/src/pytest_docker.egg-info → pytest_docker-3.2.5}/PKG-INFO +7 -3
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/README.md +5 -1
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/setup.cfg +3 -2
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker/plugin.py +3 -2
- {pytest_docker-3.2.3 → pytest_docker-3.2.5/src/pytest_docker.egg-info}/PKG-INFO +7 -3
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker.egg-info/requires.txt +1 -1
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/tests/test_docker_services.py +7 -7
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/tests/test_dockercomposeexecutor.py +4 -4
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/tests/test_fixtures.py +1 -1
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/LICENSE.txt +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/pyproject.toml +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/setup.py +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker/__init__.py +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker/py.typed +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker.egg-info/SOURCES.txt +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker.egg-info/dependency_links.txt +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker.egg-info/entry_points.txt +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/src/pytest_docker.egg-info/top_level.txt +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/tests/test_docker_ip.py +0 -0
- {pytest_docker-3.2.3 → pytest_docker-3.2.5}/tests/test_integration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-docker
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.5
|
|
4
4
|
Summary: Simple pytest fixtures for Docker and Docker Compose based tests
|
|
5
5
|
Home-page: https://github.com/avast/pytest-docker
|
|
6
6
|
Author: Max K., Andre Caron
|
|
@@ -23,7 +23,7 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
23
23
|
Requires-Python: >=3.8
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
License-File: LICENSE.txt
|
|
26
|
-
Requires-Dist: pytest<
|
|
26
|
+
Requires-Dist: pytest<10.0,>=4.0
|
|
27
27
|
Requires-Dist: attrs>=19.2.0
|
|
28
28
|
Provides-Extra: docker-compose-v1
|
|
29
29
|
Requires-Dist: docker-compose<2.0,>=1.27.3; extra == "docker-compose-v1"
|
|
@@ -133,6 +133,10 @@ def test_status_code(http_service):
|
|
|
133
133
|
assert response.status_code == status
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
> The default `docker_setup` command includes `--wait`, which respects either the
|
|
137
|
+
> image `HEALTHCHECK` or the compose `healthcheck`. Generally, if those
|
|
138
|
+
> are configured properly, `wait_until_responsive` should not be required.
|
|
139
|
+
|
|
136
140
|
By default, this plugin will try to open `docker-compose.yml` in your
|
|
137
141
|
`tests` directory. If you need to use a custom location, override the
|
|
138
142
|
`docker_compose_file` fixture inside your `conftest.py` file:
|
|
@@ -177,7 +181,7 @@ def docker_compose_project_name() -> str:
|
|
|
177
181
|
# Stop the stack before starting a new one
|
|
178
182
|
@pytest.fixture(scope="session")
|
|
179
183
|
def docker_setup():
|
|
180
|
-
return ["down -v", "up --build
|
|
184
|
+
return ["down -v", "up --build --wait"]
|
|
181
185
|
```
|
|
182
186
|
|
|
183
187
|
|
|
@@ -94,6 +94,10 @@ def test_status_code(http_service):
|
|
|
94
94
|
assert response.status_code == status
|
|
95
95
|
```
|
|
96
96
|
|
|
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
|
+
|
|
97
101
|
By default, this plugin will try to open `docker-compose.yml` in your
|
|
98
102
|
`tests` directory. If you need to use a custom location, override the
|
|
99
103
|
`docker_compose_file` fixture inside your `conftest.py` file:
|
|
@@ -138,7 +142,7 @@ def docker_compose_project_name() -> str:
|
|
|
138
142
|
# Stop the stack before starting a new one
|
|
139
143
|
@pytest.fixture(scope="session")
|
|
140
144
|
def docker_setup():
|
|
141
|
-
return ["down -v", "up --build
|
|
145
|
+
return ["down -v", "up --build --wait"]
|
|
142
146
|
```
|
|
143
147
|
|
|
144
148
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[metadata]
|
|
2
2
|
name = pytest-docker
|
|
3
|
-
version = 3.2.
|
|
3
|
+
version = 3.2.5
|
|
4
4
|
description = Simple pytest fixtures for Docker and Docker Compose based tests
|
|
5
5
|
long_description = file: README.md
|
|
6
6
|
long_description_content_type = text/markdown
|
|
@@ -30,7 +30,7 @@ package_dir =
|
|
|
30
30
|
=src
|
|
31
31
|
packages = pytest_docker
|
|
32
32
|
install_requires =
|
|
33
|
-
pytest >=4.0, <
|
|
33
|
+
pytest >=4.0, <10.0
|
|
34
34
|
attrs >=19.2.0
|
|
35
35
|
|
|
36
36
|
[options.extras_require]
|
|
@@ -79,6 +79,7 @@ strict = true
|
|
|
79
79
|
mypy_path = "src/pytest_docker,tests"
|
|
80
80
|
namespace_packages = true
|
|
81
81
|
warn_unused_ignores = true
|
|
82
|
+
warn_return_any = false
|
|
82
83
|
|
|
83
84
|
[egg_info]
|
|
84
85
|
tag_build =
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import contextlib
|
|
2
2
|
import os
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
import re
|
|
4
5
|
import subprocess
|
|
5
6
|
import time
|
|
@@ -119,7 +120,7 @@ class Services:
|
|
|
119
120
|
raise Exception("Timeout reached while waiting on service!")
|
|
120
121
|
|
|
121
122
|
|
|
122
|
-
def str_to_list(arg: Union[str, List[Any], Tuple[Any]]) -> Union[List[Any], Tuple[Any]]:
|
|
123
|
+
def str_to_list(arg: Union[str, Path, List[Any], Tuple[Any]]) -> Union[List[Any], Tuple[Any]]:
|
|
123
124
|
if isinstance(arg, (list, tuple)):
|
|
124
125
|
return arg
|
|
125
126
|
return [arg]
|
|
@@ -178,7 +179,7 @@ def docker_cleanup() -> Union[List[str], str]:
|
|
|
178
179
|
|
|
179
180
|
|
|
180
181
|
def get_setup_command() -> Union[List[str], str]:
|
|
181
|
-
return ["up --build
|
|
182
|
+
return ["up --build --wait"]
|
|
182
183
|
|
|
183
184
|
|
|
184
185
|
@pytest.fixture(scope=containers_scope)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-docker
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.5
|
|
4
4
|
Summary: Simple pytest fixtures for Docker and Docker Compose based tests
|
|
5
5
|
Home-page: https://github.com/avast/pytest-docker
|
|
6
6
|
Author: Max K., Andre Caron
|
|
@@ -23,7 +23,7 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
23
23
|
Requires-Python: >=3.8
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
25
|
License-File: LICENSE.txt
|
|
26
|
-
Requires-Dist: pytest<
|
|
26
|
+
Requires-Dist: pytest<10.0,>=4.0
|
|
27
27
|
Requires-Dist: attrs>=19.2.0
|
|
28
28
|
Provides-Extra: docker-compose-v1
|
|
29
29
|
Requires-Dist: docker-compose<2.0,>=1.27.3; extra == "docker-compose-v1"
|
|
@@ -133,6 +133,10 @@ def test_status_code(http_service):
|
|
|
133
133
|
assert response.status_code == status
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
+
> The default `docker_setup` command includes `--wait`, which respects either the
|
|
137
|
+
> image `HEALTHCHECK` or the compose `healthcheck`. Generally, if those
|
|
138
|
+
> are configured properly, `wait_until_responsive` should not be required.
|
|
139
|
+
|
|
136
140
|
By default, this plugin will try to open `docker-compose.yml` in your
|
|
137
141
|
`tests` directory. If you need to use a custom location, override the
|
|
138
142
|
`docker_compose_file` fixture inside your `conftest.py` file:
|
|
@@ -177,7 +181,7 @@ def docker_compose_project_name() -> str:
|
|
|
177
181
|
# Stop the stack before starting a new one
|
|
178
182
|
@pytest.fixture(scope="session")
|
|
179
183
|
def docker_setup():
|
|
180
|
-
return ["down -v", "up --build
|
|
184
|
+
return ["down -v", "up --build --wait"]
|
|
181
185
|
```
|
|
182
186
|
|
|
183
187
|
|
|
@@ -49,7 +49,7 @@ def test_docker_services() -> None:
|
|
|
49
49
|
# Both should have been called.
|
|
50
50
|
assert check_output.call_args_list == [
|
|
51
51
|
mock.call(
|
|
52
|
-
'docker compose -f "docker-compose.yml" -p "pytest123" up --build
|
|
52
|
+
'docker compose -f "docker-compose.yml" -p "pytest123" up --build --wait',
|
|
53
53
|
stderr=subprocess.STDOUT,
|
|
54
54
|
shell=True,
|
|
55
55
|
),
|
|
@@ -100,7 +100,7 @@ def test_docker_services_unused_port() -> None:
|
|
|
100
100
|
assert check_output.call_args_list == [
|
|
101
101
|
mock.call(
|
|
102
102
|
'docker compose -f "docker-compose.yml" -p "pytest123" '
|
|
103
|
-
|
|
103
|
+
'up --build --wait', # pylint: disable:=implicit-str-concat
|
|
104
104
|
shell=True,
|
|
105
105
|
stderr=subprocess.STDOUT,
|
|
106
106
|
),
|
|
@@ -147,7 +147,7 @@ def test_docker_services_failure() -> None:
|
|
|
147
147
|
assert check_output.call_args_list == [
|
|
148
148
|
mock.call(
|
|
149
149
|
'docker compose -f "docker-compose.yml" -p "pytest123" '
|
|
150
|
-
"up --build
|
|
150
|
+
"up --build --wait", # pylint: disable:=implicit-str-concat
|
|
151
151
|
shell=True,
|
|
152
152
|
stderr=subprocess.STDOUT,
|
|
153
153
|
)
|
|
@@ -188,7 +188,7 @@ def test_single_commands() -> None:
|
|
|
188
188
|
"docker compose",
|
|
189
189
|
"docker-compose.yml",
|
|
190
190
|
docker_compose_project_name="pytest123",
|
|
191
|
-
docker_setup="up --build
|
|
191
|
+
docker_setup="up --build --wait",
|
|
192
192
|
docker_cleanup="down -v",
|
|
193
193
|
) as services:
|
|
194
194
|
assert isinstance(services, Services)
|
|
@@ -212,7 +212,7 @@ def test_single_commands() -> None:
|
|
|
212
212
|
# Both should have been called.
|
|
213
213
|
assert check_output.call_args_list == [
|
|
214
214
|
mock.call(
|
|
215
|
-
'docker compose -f "docker-compose.yml" -p "pytest123" up --build
|
|
215
|
+
'docker compose -f "docker-compose.yml" -p "pytest123" up --build --wait',
|
|
216
216
|
stderr=subprocess.STDOUT,
|
|
217
217
|
shell=True,
|
|
218
218
|
),
|
|
@@ -242,7 +242,7 @@ def test_multiple_commands() -> None:
|
|
|
242
242
|
"docker compose",
|
|
243
243
|
"docker-compose.yml",
|
|
244
244
|
docker_compose_project_name="pytest123",
|
|
245
|
-
docker_setup=["ps", "up --build
|
|
245
|
+
docker_setup=["ps", "up --build --wait"],
|
|
246
246
|
docker_cleanup=["down -v", "ps"],
|
|
247
247
|
) as services:
|
|
248
248
|
assert isinstance(services, Services)
|
|
@@ -271,7 +271,7 @@ def test_multiple_commands() -> None:
|
|
|
271
271
|
shell=True,
|
|
272
272
|
),
|
|
273
273
|
mock.call(
|
|
274
|
-
'docker compose -f "docker-compose.yml" -p "pytest123" up --build
|
|
274
|
+
'docker compose -f "docker-compose.yml" -p "pytest123" up --build --wait',
|
|
275
275
|
stderr=subprocess.STDOUT,
|
|
276
276
|
shell=True,
|
|
277
277
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
from unittest import mock
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
from pathlib import Path
|
|
5
5
|
from pytest_docker.plugin import DockerComposeExecutor
|
|
6
6
|
|
|
7
7
|
|
|
@@ -31,9 +31,9 @@ def test_execute_docker_compose_v2() -> None:
|
|
|
31
31
|
]
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
def
|
|
35
|
-
compose_file:
|
|
36
|
-
docker_compose = DockerComposeExecutor("docker compose", compose_file, "pytest123")
|
|
34
|
+
def test_path_compose_file() -> None:
|
|
35
|
+
compose_file: Path = Path("/tmp/docker-compose.yml")
|
|
36
|
+
docker_compose = DockerComposeExecutor("docker compose", compose_file, "pytest123")
|
|
37
37
|
with mock.patch("subprocess.check_output") as check_output:
|
|
38
38
|
docker_compose.execute("up")
|
|
39
39
|
assert check_output.call_args_list == [
|
|
@@ -21,7 +21,7 @@ def test_docker_cleanup(docker_cleanup: List[str]) -> None:
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def test_docker_setup(docker_setup: List[str]) -> None:
|
|
24
|
-
assert docker_setup == ["up --build
|
|
24
|
+
assert docker_setup == ["up --build --wait"]
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def test_docker_compose_comand(docker_compose_command: str) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|