diff --git a/product/ERP5Type/tests/runUnitTest.py b/product/ERP5Type/tests/runUnitTest.py
index 9a14b5e500a55b62f01bd2965b27d06b3d2cb4af..d353cf01a3c173db09401f2282c8e3b3ef212b01 100755
--- a/product/ERP5Type/tests/runUnitTest.py
+++ b/product/ERP5Type/tests/runUnitTest.py
@@ -316,6 +316,9 @@ class DebugTestResult:
     self.result = result
 
   def _start_debugger(self, tb):
+    import Lifetime
+    if Lifetime._shutdown_phase:
+      return
     try:
       # try ipython if available
       import IPython