From d9eb61efc435f3b73e036e19e664b77b33d6fa49 Mon Sep 17 00:00:00 2001 From: grossmj Date: Fri, 11 Aug 2023 17:37:11 +1000 Subject: [PATCH] Fix tests with asyncio_patch --- tests/compute/docker/test_docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/compute/docker/test_docker.py b/tests/compute/docker/test_docker.py index 98096deb..cb6f2e4d 100644 --- a/tests/compute/docker/test_docker.py +++ b/tests/compute/docker/test_docker.py @@ -221,7 +221,7 @@ async def test_install_busybox(): with patch("os.path.isfile", return_value=False): with patch("shutil.which", return_value="/usr/bin/busybox"): - with patch("asyncio.create_subprocess_exec", return_value=mock_process) as create_subprocess_mock: + with asyncio_patch("asyncio.create_subprocess_exec", return_value=mock_process) as create_subprocess_mock: with patch("shutil.copy2") as copy2_mock: await Docker.install_busybox() create_subprocess_mock.assert_called_with( @@ -242,7 +242,7 @@ async def test_install_busybox_dynamic_linked(): with patch("os.path.isfile", return_value=False): with patch("shutil.which", return_value="/usr/bin/busybox"): - with patch("asyncio.create_subprocess_exec", return_value=mock_process): + with asyncio_patch("asyncio.create_subprocess_exec", return_value=mock_process): with pytest.raises(DockerError) as e: await Docker.install_busybox() assert str(e.value) == "No busybox executable could be found"