From 21834f8362d7752c9d6c747202c7ed35e076344b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 4 Feb 2022 15:44:29 +0100 Subject: [PATCH] ci: make pytest build script compatible with pytest 7.x --- tools/ci/idf_ci_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/ci/idf_ci_utils.py b/tools/ci/idf_ci_utils.py index d76468dee63..6327e4fa447 100644 --- a/tools/ci/idf_ci_utils.py +++ b/tools/ci/idf_ci_utils.py @@ -105,6 +105,11 @@ def pytest_collection_modifyitems(self, items: List[Item]) -> None: raise RuntimeError('pytest collection failed') sys.stdout.flush() # print instantly - test_file_paths = set(node.fspath for node in collector.nodes) + + try: + test_file_paths = set(node.path for node in collector.nodes) + except AttributeError: + # pytest 6.x + test_file_paths = set(node.fspath for node in collector.nodes) return [os.path.dirname(file) for file in test_file_paths]