Skip to content

Commit 3aecc6a

Browse files
fix logic
1 parent 53b8e3d commit 3aecc6a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

core/tests/test_docker_in_docker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
_DIND_PYTHON_VERSION = (3, 13)
2424

2525

26-
def _should_run_dind() -> bool:
26+
def _should_skip_dind() -> bool:
2727
# todo refine macos check -> run in ci but not locally
28-
return not is_mac() and tuple([*sys.version_info][:2]) == _DIND_PYTHON_VERSION
28+
return is_mac() or tuple([*sys.version_info][:2]) != _DIND_PYTHON_VERSION
2929

3030

3131
def _wait_for_dind_return_ip(client: DockerClient, dind: Container):
@@ -46,7 +46,7 @@ def _wait_for_dind_return_ip(client: DockerClient, dind: Container):
4646
return docker_host_ip
4747

4848

49-
@pytest.mark.skipif(_should_run_dind(), reason="Docker socket forwarding (socat) is unsupported on Docker Desktop for macOS")
49+
@pytest.mark.skipif(_should_skip_dind(), reason="Docker socket forwarding (socat) is unsupported on Docker Desktop for macOS")
5050
def test_wait_for_logs_docker_in_docker():
5151
# real dind isn't possible (AFAIK) in CI
5252
# forwarding the socket to a container port is at least somewhat the same
@@ -76,7 +76,7 @@ def test_wait_for_logs_docker_in_docker():
7676

7777

7878
@pytest.mark.skipif(
79-
_should_run_dind(), reason="Bridge networking and Docker socket forwarding are not supported on Docker Desktop for macOS"
79+
_should_skip_dind(), reason="Bridge networking and Docker socket forwarding are not supported on Docker Desktop for macOS"
8080
)
8181
def test_dind_inherits_network():
8282
client = DockerClient()
@@ -160,7 +160,7 @@ def get_docker_info() -> dict[str, Any]:
160160
# see https://forums.docker.com/t/get-a-containers-full-id-from-inside-of-itself
161161
@pytest.mark.xfail(reason="Does not work in rootles docker i.e. github actions")
162162
@pytest.mark.inside_docker_check
163-
@pytest.mark.skipif(_should_run_dind() or not os.environ.get(EXPECTED_NETWORK_VAR), reason="No expected network given")
163+
@pytest.mark.skipif(_should_skip_dind() or not os.environ.get(EXPECTED_NETWORK_VAR), reason="No expected network given")
164164
def test_find_host_network_in_dood() -> None:
165165
"""
166166
Check that the correct host network is found for DooD
@@ -173,7 +173,7 @@ def test_find_host_network_in_dood() -> None:
173173

174174

175175
@pytest.mark.skipif(
176-
_should_run_dind(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS"
176+
_should_skip_dind(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS"
177177
)
178178
@pytest.mark.skipif(not Path(tcc.ryuk_docker_socket).exists(), reason="No docker socket available")
179179
def test_dood(python_testcontainer_image: str) -> None:
@@ -211,7 +211,7 @@ def test_dood(python_testcontainer_image: str) -> None:
211211

212212

213213
@pytest.mark.skipif(
214-
_should_run_dind(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS"
214+
_should_skip_dind(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS"
215215
)
216216
def test_dind(python_testcontainer_image: str, tmp_path: Path) -> None:
217217
"""

0 commit comments

Comments
 (0)