[Zodb-checkins] SVN: ZODB/trunk/test.py Tried to prevent errors
generated by the logging package at exit.
Jim Fulton
jim at zope.com
Thu May 4 13:10:24 EDT 2006
Log message for revision 67965:
Tried to prevent errors generated by the logging package at exit.
I finally had to resort to os._exit, which I'm not happy about,
although I don't suppose it could do any harm for the test runner.
I wonder is a test is leaving something behind it shouldn't.
Also return the test result status as the exit status.
Changed:
U ZODB/trunk/test.py
-=-
Modified: ZODB/trunk/test.py
===================================================================
--- ZODB/trunk/test.py 2006-05-04 15:35:44 UTC (rev 67964)
+++ ZODB/trunk/test.py 2006-05-04 17:10:23 UTC (rev 67965)
@@ -18,11 +18,11 @@
See the docs for zope.testing; test.py is a small driver for
zope.testing.testrunner.
"""
-
+from distutils.util import get_platform
+import logging
+import os
+import sys
import warnings
-import sys
-import os
-from distutils.util import get_platform
# If ``setup.py build_ext -i`` was used, we want to get code from src/.
# Else (``setup.py build``) we have to look in a funky platform-specific
@@ -62,4 +62,10 @@
"--path", path,
]
-testrunner.run(defaults)
+result = testrunner.run(defaults)
+
+# Try to avoid spurious error during exit. Some thing is trying to log
+# something after the files used by the logger have been closed.
+logging.disable(999999999)
+import os
+os._exit(result)
More information about the Zodb-checkins
mailing list