diff options
author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2009-01-20 12:10:48 +0100 |
---|---|---|
committer | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> | 2009-01-20 12:10:48 +0100 |
commit | a243379ca0bdabeb2d440d64496469839c01a07b (patch) | |
tree | 5a8f752c7b5436767ab6857e2d3bcbdd78e49276 | |
parent | 04e8f764e511bd0106bbc082c118e618a0b9b537 (diff) | |
download | logilab-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.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 |