From a6c62bdfb63295f4c1880850a0bcce4ea984f842 Mon Sep 17 00:00:00 2001 From: Peter Dragun Date: Wed, 28 Feb 2024 09:41:21 +0100 Subject: [PATCH] fix(tools): fix python dependecy test on windows --- tools/test_idf_tools/test_idf_tools_python_env.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test_idf_tools/test_idf_tools_python_env.py b/tools/test_idf_tools/test_idf_tools_python_env.py index bbd769b343..370a30a341 100644 --- a/tools/test_idf_tools/test_idf_tools_python_env.py +++ b/tools/test_idf_tools/test_idf_tools_python_env.py @@ -29,7 +29,8 @@ PYTHON_DIR = os.path.join(TOOLS_DIR, 'python_env') PYTHON_DIR_BACKUP = tempfile.mkdtemp() PYTHON_BINARY = os.path.join('Scripts', 'python.exe') if sys.platform == 'win32' else os.path.join('bin', 'python') REQ_SATISFIED = 'Python requirements are satisfied' -REQ_MISSING = 'Package was not found and is required by the application: {}' +# Python 3.8 and 3.9 has a different error message that does not include the "No package metadata was found for" part +REQ_MISSING = r'Package was not found and is required by the application: (No package metadata was found for )?{}' REQ_CORE = '- {}'.format(os.path.join(IDF_PATH, 'tools', 'requirements', 'requirements.core.txt')) REQ_GDBGUI = '- {}'.format(os.path.join(IDF_PATH, 'tools', 'requirements', 'requirements.gdbgui.txt')) CONSTR = 'Constraint file: {}'.format(os.path.join(TOOLS_DIR, 'espidf.constraints')) @@ -346,7 +347,7 @@ class TestCheckPythonDependencies(BasePythonInstall): # check-python-dependencies should fail as the package was not installed yet output = self.run_idf_tools(['check-python-dependencies']) - self.assertIn(REQ_MISSING.format('foopackage'), output) + self.assertRegex(output, REQ_MISSING.format('foopackage')) self.assertNotIn(REQ_SATISFIED, output) def test_dev_version(self): # type: () -> None