Skip to content

Commit 4cf9c83

Browse files
committed
Simplified logic using the check inside the loop
1 parent 9cf65b5 commit 4cf9c83

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

easybuild/tools/testing.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,13 @@ def create_test_report(msg, ecs_with_res, init_session_state, pr_nrs=None, gist_
323323
for key in sorted(environ_dump.keys()):
324324
if env_filter is not None and env_filter.search(key):
325325
continue
326+
if any(x in key.upper() for x in DEFAULT_EXCLUDE_FROM_TEST_REPORT_ENV_VAR_NAMES + _exclude_env_from_report):
327+
continue
326328
value = environ_dump[key]
327329
if any(re.match(rgx, value) for rgx in DEFAULT_EXCLUDE_FROM_TEST_REPORT_VALUE_REGEX):
328330
continue
329331
environment += ["%s = %s" % (key, value)]
330332

331-
environment = list(filter(
332-
lambda x: not any(y in x.upper() for y in DEFAULT_EXCLUDE_FROM_TEST_REPORT_ENV_VAR_NAMES + _exclude_env_from_report),
333-
environment
334-
))
335-
336333
test_report.extend(["#### Environment", "```"] + environment + ["```"])
337334

338335
return {'full': '\n'.join(test_report), 'overview': '\n'.join(build_overview)}

0 commit comments

Comments
 (0)