From cad2f1a2a7f1811e7a8955eb3b06de94909eb9dc Mon Sep 17 00:00:00 2001 From: Julian Lettner Date: Mon, 15 Jun 2020 16:15:28 -0700 Subject: [PATCH] Follow up for "[lit] Include unexecuted tests in xUnit report" The extended test fails on bots that still run lit tests with Python 2. https://reviews.llvm.org/D81316 --- utils/lit/tests/Inputs/xunit-output/dummy_format.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/lit/tests/Inputs/xunit-output/dummy_format.py b/utils/lit/tests/Inputs/xunit-output/dummy_format.py index 94410d215d3..59e75eb6860 100644 --- a/utils/lit/tests/Inputs/xunit-output/dummy_format.py +++ b/utils/lit/tests/Inputs/xunit-output/dummy_format.py @@ -23,9 +23,10 @@ class DummyFormat(lit.formats.FileBasedTest): result = lit.Test.Result(getattr(lit.Test, result_code), result_output) - required_feature = cfg.get('global', 'required_feature', fallback=None) - if required_feature: - test.requires.append(required_feature) + if cfg.has_option('global', 'required_feature'): + required_feature = cfg.get('global', 'required_feature') + if required_feature: + test.requires.append(required_feature) # Load additional metrics. for key,value_str in cfg.items('results'):