diff --git a/dockertidy/tests/unit/test_autostop.py b/dockertidy/tests/unit/test_autostop.py index 51ef67f..8b76fdf 100644 --- a/dockertidy/tests/unit/test_autostop.py +++ b/dockertidy/tests/unit/test_autostop.py @@ -11,7 +11,13 @@ pytest_plugins = [ @pytest.fixture -def autostop(): +def autostop(mocker): + mocker.patch.object( + Autostop.AutoStop, + "_get_docker_client", + return_value=mocker.create_autospec(docker.APIClient) + ) + stop = Autostop.AutoStop() return stop diff --git a/dockertidy/tests/unit/test_garbagecollector.py b/dockertidy/tests/unit/test_garbagecollector.py index 7d2ec97..9f48f87 100644 --- a/dockertidy/tests/unit/test_garbagecollector.py +++ b/dockertidy/tests/unit/test_garbagecollector.py @@ -12,7 +12,13 @@ pytest_plugins = [ @pytest.fixture -def gc(): +def gc(mocker): + mocker.patch.object( + GarbageCollector.GarbageCollector, + "_get_docker_client", + return_value=mocker.create_autospec(docker.APIClient) + ) + gc = GarbageCollector.GarbageCollector() return gc