Skip to content

Commit e7b2d9e

Browse files
authored
Merge pull request #1655 from Emantor/fix/docker-conditional-import
Fix docker conditional import for tests
2 parents f4ecb49 + c2de949 commit e7b2d9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_docker.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"""
55

66
import pytest
7-
import docker
87
import io
98

109
from labgrid import Environment
@@ -161,6 +160,7 @@ def test_docker_with_daemon(command):
161160

162161
@pytest.fixture
163162
def build_image():
163+
import docker
164164
client = docker.from_env()
165165
dockerfile_content = """
166166
FROM rastasheep/ubuntu-sshd:16.04
@@ -198,6 +198,7 @@ def test_docker_without_daemon(docker_env, mocker):
198198
DockerManager and DockerStrategy without using an actual
199199
docker daemon, real sockets or system time"""
200200

201+
import docker
201202
# Target::update_resources() and Target::await_resources use
202203
# time.monotonic() and time.sleep() to control when to search
203204
# for resources. Avoid time delays and make running from cmd-line

0 commit comments

Comments
 (0)