From 6fc64d9e03d3e34a55c2792fa2e80c1b9a4b93a0 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 9 Feb 2018 21:41:17 +0100 Subject: Read the env file only if exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8e718e583a5a47a089755c31e623a44732e5ba1e Signed-off-by: Cédric Ollivier --- functest/tests/unit/ci/test_run_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'functest/tests/unit/ci') diff --git a/functest/tests/unit/ci/test_run_tests.py b/functest/tests/unit/ci/test_run_tests.py index aaa265c5..bc967743 100644 --- a/functest/tests/unit/ci/test_run_tests.py +++ b/functest/tests/unit/ci/test_run_tests.py @@ -92,7 +92,8 @@ class RunTestsTesting(unittest.TestCase): envfile = 'rc_file' with mock.patch('six.moves.builtins.open', mock.mock_open(read_data=msg), - create=True) as mock_method: + create=True) as mock_method,\ + mock.patch('os.path.isfile', return_value=True): mock_method.return_value.__iter__ = lambda self: iter( self.readline, '') self.runner.source_envfile(envfile) -- cgit 1.2.3-korg