Skip to content

Commit cf97720

Browse files
test: Skip from_env_unix tests if DOCKER_HOST is network socket
Signed-off-by: Ricardo Branco <[email protected]>
1 parent 65f7f0c commit cf97720

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/unit/client_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ def test_from_env_without_timeout_uses_default(self):
188188
assert client.api.timeout == DEFAULT_TIMEOUT_SECONDS
189189

190190
@pytest.mark.skipif(
191-
IS_WINDOWS_PLATFORM, reason='Unix Connection Pool only on Linux'
191+
os.environ.get('DOCKER_HOST', '').startswith('tcp://') or IS_WINDOWS_PLATFORM,
192+
reason='Requires a Unix socket'
192193
)
193194
@mock.patch("docker.transport.unixconn.UnixHTTPConnectionPool")
194195
def test_default_pool_size_from_env_unix(self, mock_obj):
@@ -219,7 +220,8 @@ def test_default_pool_size_from_env_win(self, mock_obj):
219220
)
220221

221222
@pytest.mark.skipif(
222-
IS_WINDOWS_PLATFORM, reason='Unix Connection Pool only on Linux'
223+
os.environ.get('DOCKER_HOST', '').startswith('tcp://') or IS_WINDOWS_PLATFORM,
224+
reason='Requires a Unix socket'
223225
)
224226
@mock.patch("docker.transport.unixconn.UnixHTTPConnectionPool")
225227
def test_pool_size_from_env_unix(self, mock_obj):

0 commit comments

Comments
 (0)