test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH 1/3] framework/test_result: Fix circular import
@ 2021-08-09 11:24 ohilyard
  2021-08-09 11:24 ` [dts] [PATCH 2/3] requirements: Added required modules to requirements ohilyard
  2021-08-09 11:24 ` [dts] [PATCH 3/3] ci/initial: Added script to get the tests for a patchset ohilyard
  0 siblings, 2 replies; 3+ messages in thread
From: ohilyard @ 2021-08-09 11:24 UTC (permalink / raw)
  To: dts; +Cc: lijuan.tu, Owen Hilyard

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
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-09 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 11:24 [dts] [PATCH 1/3] framework/test_result: Fix circular import ohilyard
2021-08-09 11:24 ` [dts] [PATCH 2/3] requirements: Added required modules to requirements ohilyard
2021-08-09 11:24 ` [dts] [PATCH 3/3] ci/initial: Added script to get the tests for a patchset ohilyard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).