[dts] [PATCH 1/3] framework/test_result: Fix circular import

ohilyard at iol.unh.edu ohilyard at iol.unh.edu
Mon Aug 9 13:24:02 CEST 2021


From: Owen Hilyard <ohilyard at iol.unh.edu>

This circular import is normally fine because the debugger module is
initialized before test_case is imported, but since that is not
necessarily the case with the dependency script, the circular import
needed to be removed.

Signed-off-by: Owen Hilyard <ohilyard at iol.unh.edu>
---
 framework/test_case.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/framework/test_case.py b/framework/test_case.py
index 98b716b9..3d7bc30e 100644
--- a/framework/test_case.py
+++ b/framework/test_case.py
@@ -33,7 +33,6 @@
 A base class for creating DTF test cases.
 """
 import re
-import debugger
 import traceback
 import signal
 import time
@@ -374,6 +373,10 @@ class TestCase(object):
         """
         Execute all test cases in one suite.
         """
+
+        # local import to avoid circular import
+        import debugger
+
         # prepare debugger rerun case environment
         if self._enable_debug or self._debug_case:
             debugger.AliveSuite = self
-- 
2.30.2



More information about the dts mailing list