summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2009-01-20 12:10:48 +0100
committerAdrien Di Mascio <Adrien.DiMascio@logilab.fr>2009-01-20 12:10:48 +0100
commita243379ca0bdabeb2d440d64496469839c01a07b (patch)
tree5a8f752c7b5436767ab6857e2d3bcbdd78e49276
parent04e8f764e511bd0106bbc082c118e618a0b9b537 (diff)
downloadlogilab-common-a243379ca0bdabeb2d440d64496469839c01a07b.tar.gz
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.
-rw-r--r--testlib.py7
1 files 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