From: Ben Darnell Date: Sun, 28 Apr 2013 21:29:26 +0000 (-0400) Subject: Add a --debug_gc flag to runtests to easily turn on extra logging. X-Git-Tag: v3.1.0~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2d2eb2c70c480bef01d91e5b028b71d424efa13;p=thirdparty%2Ftornado.git Add a --debug_gc flag to runtests to easily turn on extra logging. --- diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index e9e21bda8..22cda522d 100644 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -1,7 +1,9 @@ #!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement +import gc import logging +import operator import textwrap import sys from tornado.httpclient import AsyncHTTPClient @@ -88,6 +90,11 @@ if __name__ == '__main__': define('ioloop_time_monotonic', default=False) define('resolver', type=str, default=None, callback=Resolver.configure) + define('debug_gc', type=str, multiple=True, + help="A comma-separated list of gc module debug constants, " + "e.g. DEBUG_STATS or DEBUG_COLLECTABLE,DEBUG_OBJECTS", + callback=lambda values: gc.set_debug( + reduce(operator.or_, (getattr(gc, v) for v in values)))) def configure_ioloop(): kwargs = {}