Skip to content

Commit

Permalink
Enable strict warnings in test runs.
Browse files Browse the repository at this point in the history
This includes python 3.2's ResourceWarnings, which exposed the
socket leaks fixed in the previous commit.
  • Loading branch information
bdarnell committed Feb 1, 2012
1 parent fa64343 commit 65531ed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tornado/test/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 65531ed

Please sign in to comment.