[v2,1/3] framework/test_result: Fix circular import

Message ID 20210809124101.13719-1-ohilyard@iol.unh.edu (mailing list archive)
State Superseded
Series [v2,1/3] framework/test_result: Fix circular import |

Commit Message

Owen Hilyard Aug. 9, 2021, 12:40 p.m. UTC
  From: Owen Hilyard <ohilyard@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@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