From a243379ca0bdabeb2d440d64496469839c01a07b Mon Sep 17 00:00:00 2001 From: Adrien Di Mascio Date: Tue, 20 Jan 2009 12:10:48 +0100 Subject: add a __unittest variable to testlib (unittest.py uses it) unittest checks if a __unittest variable is found in the frame's global variables to decide whether or not this frame is relevant in the final traceback. --- testlib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testlib.py b/testlib.py index f4f3fe4..bfd850a 100644 --- a/testlib.py +++ b/testlib.py @@ -45,9 +45,6 @@ from warnings import warn from compiler.consts import CO_GENERATOR from ConfigParser import ConfigParser - -# PRINT_ = file('stdout.txt', 'w').write - try: from test import test_support except ImportError: @@ -73,6 +70,7 @@ from logilab.common.modutils import load_module_from_name from logilab.common.debugger import Debugger from logilab.common.decorators import cached from logilab.common import textutils + __all__ = ['main', 'unittest_main', 'find_tests', 'run_test', 'spawn'] @@ -83,6 +81,9 @@ ENABLE_DBC = False FILE_RESTART = ".pytest.restart" +# used by unittest to count the number of relevant levels in the traceback +__unittest = 1 + def with_tempdir(callable): """A decorator ensuring no temporary file left when the function return -- cgit v1.2.1