From 90526881ff43d723447e8535290656d61b968e33 Mon Sep 17 00:00:00 2001 From: lonly7star <40080387+lonly7star@users.noreply.github.com> Date: Sat, 20 Nov 2021 00:40:16 -0600 Subject: [PATCH] fix flaky test on test_get_docker_client fix flaky test on test_get_docker_client::ReleaseUtilsTest::test_get_docker_client --- tests/image/test_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/image/test_utils.py b/tests/image/test_utils.py index f942b946..21dbd319 100644 --- a/tests/image/test_utils.py +++ b/tests/image/test_utils.py @@ -30,6 +30,13 @@ def test_get_project_dir(self): assert get_project_dir() == tmpdir def test_get_docker_client(self): + # delete basic test environment + if os.environ.get('DOCKER_HOST', False): + del os.environ['DOCKER_HOST'] + if os.environ.get('DOCKER_TLS_VERIFY', False): + del os.environ['DOCKER_TLS_VERIFY'] + if os.environ.get('DOCKER_API_VERSION', False): + del os.environ['DOCKER_API_VERSION'] mocked_docker = mock.Mock() sys.modules['docker'] = mocked_docker client_mock = mock.Mock()