Skip to content

Commit ce500ac

Browse files
committed
Fix AttributeError when multitest has no parent
Use getattr with default value to safely access testcase_timeout config. This prevents AttributeError when multitest doesn't have a parent config. Addresses review comment on PR morganstanley#1241
1 parent 672339c commit ce500ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

testplan/testing/multitest/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,9 @@ def _run_testcase(
12311231

12321232
time_restriction = getattr(testcase, "timeout", None)
12331233
# Use default testcase timeout from config if no explicit timeout is set
1234-
if time_restriction is None and self.cfg.testcase_timeout:
1234+
if time_restriction is None and getattr(
1235+
self.cfg, "testcase_timeout", None
1236+
):
12351237
time_restriction = self.cfg.testcase_timeout
12361238
if time_restriction:
12371239
# pylint: disable=unbalanced-tuple-unpacking

0 commit comments

Comments
 (0)