(This doesn't work on python 2.6)
--- /dev/null
+"""Shim to allow python -m tornado.test.
+
+This only works in python 2.7+.
+"""
+from __future__ import absolute_import, division, print_function, with_statement
+
+from tornado.test.runtests import all, main
+
+# tornado.testing.main autodiscovery relies on 'all' being present in
+# the main module, so import it here even though it is not used directly.
+# The following line prevents a pyflakes warning.
+all = all
+
+main()
self.stream.write("\n")
return result
-if __name__ == '__main__':
+def 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.
kwargs['warnings'] = False
kwargs['testRunner'] = TornadoTextTestRunner
tornado.testing.main(**kwargs)
+
+if __name__ == '__main__':
+ main()