From: Ben Darnell Date: Wed, 1 Feb 2012 17:15:23 +0000 (-0800) Subject: Enable strict warnings in test runs. X-Git-Tag: v2.3.0~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65531eda0f1584cb3c8552cef8593cbf69536139;p=thirdparty%2Ftornado.git Enable strict warnings in test runs. This includes python 3.2's ResourceWarnings, which exposed the socket leaks fixed in the previous commit. --- diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py index 188aee823..92bd2ac0a 100755 --- a/tornado/test/runtests.py +++ b/tornado/test/runtests.py @@ -29,5 +29,19 @@ def all(): return unittest.defaultTestLoader.loadTestsFromNames(TEST_MODULES) if __name__ == '__main__': + # The -W command-line option does not work in a virtualenv with + # python 3 (as of virtualenv 1.7), so configure warnings + # programmatically instead. + import warnings + # Be strict about most warnings. This also turns on warnings that are + # ignored by default, including DeprecationWarnings and + # python 3.2's ResourceWarnings. + warnings.filterwarnings("error") + # Tornado shouldn't use anything deprecated, but some of our + # dependencies do (last match wins). + warnings.filterwarnings("ignore", category=DeprecationWarning) + warnings.filterwarnings("error", category=DeprecationWarning, + module=r"tornado\..*") + import tornado.testing tornado.testing.main()