From: Kyr Shatskyy Date: Mon, 6 Sep 2021 12:36:55 +0000 (+0200) Subject: test/test_worker: fix test_prep_job teuth_config mocking X-Git-Tag: 1.2.0~239^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1672%2Fhead;p=teuthology.git test/test_worker: fix test_prep_job teuth_config mocking When home directory contains .teuthology.yaml the test_prep_job can pick unexpected values, like teuthology_path which makes tests fail. This fix overrides teuthology config to avoid unexpected behaviour. Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/test/test_worker.py b/teuthology/test/test_worker.py index 49c3dd178..b0885b974 100644 --- a/teuthology/test/test_worker.py +++ b/teuthology/test/test_worker.py @@ -179,8 +179,10 @@ class TestWorker(object): @patch("os.path.isdir") @patch("teuthology.worker.fetch_teuthology") + @patch("teuthology.worker.teuth_config") @patch("teuthology.worker.fetch_qa_suite") def test_prep_job(self, m_fetch_qa_suite, + m_teuth_config, m_fetch_teuthology, m_isdir): config = dict( name="the_name", @@ -191,6 +193,7 @@ class TestWorker(object): m_fetch_teuthology.return_value = '/teuth/path' m_fetch_qa_suite.return_value = '/suite/path' m_isdir.return_value = True + m_teuth_config.teuthology_path = None got_config, teuth_bin_path = worker.prep_job( config, log_file_path,