Skip to content

Commit 49a988b

Browse files
Merge pull request #23671 from ricardobranco777/dockerpy3366
python_docker: Backport PR#3366
2 parents eba20b8 + e1a27cc commit 49a988b

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

data/containers/patches.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,25 @@ docker-py:
149149
# https://github.com/docker/docker-py/pull/3231 - Bump default API version to 1.44 (Moby 25.0)
150150
# https://github.com/docker/docker-py/pull/3290 - tests/exec: expect 127 exit code for missing executable
151151
# https://github.com/docker/docker-py/pull/3354 - tests: Fix deprecation warning for utcfromtimestamp()
152+
# https://github.com/docker/docker-py/pull/3366 - test: Skip from_env_unix tests if DOCKER_HOST is network socket
152153
opensuse-Tumbleweed:
153154
GITHUB_PATCHES:
154155
- 3290
155156
- 3354
157+
- 3366
156158
sle-16.0:
157159
GITHUB_PATCHES:
158160
- 3290
159161
- 3354
162+
- 3366
160163
sle-15-SP7:
161164
GITHUB_PATCHES:
162165
- 3199
163166
- 3203
164167
- 3206
165168
- 3231
166169
- 3290
170+
- 3366
167171
netavark:
168172
# Note on patches:
169173
# https://github.com/containers/netavark/pull/1191 is needed for 001-basic
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
From cf97720bd35c718552e60c8c4f085bc94744e054 Mon Sep 17 00:00:00 2001
2+
From: Ricardo Branco <[email protected]>
3+
Date: Sat, 18 Oct 2025 11:32:43 +0200
4+
Subject: [PATCH] test: Skip from_env_unix tests if DOCKER_HOST is network
5+
socket
6+
7+
Signed-off-by: Ricardo Branco <[email protected]>
8+
---
9+
tests/unit/client_test.py | 6 ++++--
10+
1 file changed, 4 insertions(+), 2 deletions(-)
11+
12+
diff --git a/tests/unit/client_test.py b/tests/unit/client_test.py
13+
index 60a6d5c0f5..5ba712d240 100644
14+
--- a/tests/unit/client_test.py
15+
+++ b/tests/unit/client_test.py
16+
@@ -188,7 +188,8 @@ def test_from_env_without_timeout_uses_default(self):
17+
assert client.api.timeout == DEFAULT_TIMEOUT_SECONDS
18+
19+
@pytest.mark.skipif(
20+
- IS_WINDOWS_PLATFORM, reason='Unix Connection Pool only on Linux'
21+
+ os.environ.get('DOCKER_HOST', '').startswith('tcp://') or IS_WINDOWS_PLATFORM,
22+
+ reason='Requires a Unix socket'
23+
)
24+
@mock.patch("docker.transport.unixconn.UnixHTTPConnectionPool")
25+
def test_default_pool_size_from_env_unix(self, mock_obj):
26+
@@ -219,7 +220,8 @@ def test_default_pool_size_from_env_win(self, mock_obj):
27+
)
28+
29+
@pytest.mark.skipif(
30+
- IS_WINDOWS_PLATFORM, reason='Unix Connection Pool only on Linux'
31+
+ os.environ.get('DOCKER_HOST', '').startswith('tcp://') or IS_WINDOWS_PLATFORM,
32+
+ reason='Requires a Unix socket'
33+
)
34+
@mock.patch("docker.transport.unixconn.UnixHTTPConnectionPool")
35+
def test_pool_size_from_env_unix(self, mock_obj):

tests/containers/python_docker.pm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ sub test ($target) {
6363

6464
# Used by pytest to ignore individual tests
6565
# Format: "FILE::CLASS::FUNCTION"
66-
my @deselect = (
67-
# These tests will fail if DOCKER_HOST is set
68-
"tests/unit/client_test.py::FromEnvTest::test_default_pool_size_from_env_unix",
69-
"tests/unit/client_test.py::FromEnvTest::test_pool_size_from_env_unix",
70-
);
66+
my @deselect = ();
7167
my $deselect = join " ", map { "--deselect=$_" } @deselect;
7268

7369
my %env = (

0 commit comments

Comments
 (0)