Ben Darnell [Sat, 15 Mar 2014 04:45:09 +0000 (00:45 -0400)]
Refactor unittest/unittest2 imports to fix issues with unittest2 on py3.
Never use unittest2 on python 3 (it appears to not interoperate with
the standard unittest module). On python 2, use the same logic in
tornado.testing and tornado.test.util to select an implementation.
Ben Darnell [Thu, 13 Mar 2014 14:15:41 +0000 (10:15 -0400)]
Improve simple_httpclient ssl configuration to pass howsmyssl.com.
Remove insecure cipher suites and disable TLS compression. The option
to disable compression was only added in Python 3.3 so we do not
pass the test on older versions, but we come as close as possible with
the APIs available.
Doug Goldstein [Fri, 28 Feb 2014 14:48:26 +0000 (08:48 -0600)]
define and use errno_from_exception abstraction
If an OSError or IOError are instantiated without an errno value, e.g.
e = OSError(). The existing code would give an IndexError: tuple index
out of range. However there have been cases that the errno attribute
wasn't populated so instead of switching to it this introduces a helper
function to ensure we get the errno value through whatever means
possible.
Ben Darnell [Wed, 19 Feb 2014 04:15:19 +0000 (23:15 -0500)]
Document the fact that tornado.options configures logging by default.
Add tests and comments for how to disable this configuration.
Make it slightly easier to disable by making the command line
flag case-insensitive and allowing `None` instead of the string "none"
when setting the flag in code.
Ben Darnell [Mon, 17 Feb 2014 02:39:19 +0000 (21:39 -0500)]
Bring Future support for IOStream read operations into IOStream itself.
This speeds things up in comparison to the _iostream_return_future
decorator by removing unnecessary abstraction and especially by allowing
Futures to bypass some of the hoops IOStream jumps through to ensure a
clean slate for its callbacks.
Ben Darnell [Mon, 17 Feb 2014 01:29:37 +0000 (20:29 -0500)]
Fold TracebackFuture into Future.
Since it is no longer possible for TracebackFuture to modify
concurrent.futures.Future instead, there is no need for separate
classes. Removing the subclass speeds things up a bit by removing
a level of indirection.
Ben Darnell [Sun, 26 Jan 2014 18:55:57 +0000 (13:55 -0500)]
gen: Defer creation of stack context until a YieldPoint is reached.
The runner alone can catch all necessary exceptions as long as Futures
are used; stack contexts are only needed for YieldPoints (especially
Callback/Wait; Task could be changed to use a local-only stack
context).
This is slightly backwards incompatible for code that assumes the existence
of a stack context without yielding anything.
Ben Darnell [Mon, 27 Jan 2014 00:11:51 +0000 (19:11 -0500)]
Detect stack context inconsistency in gen.Runner.
The existing checks in StackContext.__exit__ are run after the damage has
been done and may raise exceptions in the wrong place; gen.Runner
is a more reliable place to detect this problem.
Throwing the exception into the generator provides a better stack trace
for the problem and also simplifies some of the complexity of testing for
this feature.
Ben Darnell [Mon, 20 Jan 2014 22:57:57 +0000 (17:57 -0500)]
Pivot tornado.gen to use Futures natively.
This improves performance of applications using @coroutine and Futures,
at the expense of some performance degradation for the older YieldPoint
interfaces.
Ben Darnell [Sat, 18 Jan 2014 18:09:18 +0000 (13:09 -0500)]
Allow and encourage the use of file objects instead of integer fds in IOLoop.
This fixes a problem in tests in which a closing IOLoop would os.close()
all of its file descriptors while socket objects for those fds still
existed. When those socket objects were garbage collected, they would
close the fd a second time (by which time it may have been reassigned
to a new socket).
Due to subtleties of garbage collection this has only been observed
with the asyncio event loop in tests of curl_httpclient.
Ben Darnell [Sat, 18 Jan 2014 01:57:57 +0000 (20:57 -0500)]
Add pycares to the -full tox configs and remove custom resolver tests.
The resolvers are tested in netutil_test when their dependencies are
available, and re-running the entire test suite with a different resolver
is unlikely to expose any new problems. (the resolver tests are still
present in travis.yml for now, though)
Ben Darnell [Fri, 17 Jan 2014 03:32:32 +0000 (22:32 -0500)]
Add a new TORNADO_EXTENSION environment variable for testing purposes.
This variable can be set to 0 to suppress or 1 to require the use of the
extension (instead of the default to use it when it is available but silently
fall back). Require the extension to be present on travis-ci.
Ben Darnell [Wed, 15 Jan 2014 04:16:26 +0000 (23:16 -0500)]
Refactor the unwieldy tox.ini file.
Fill in some gaps in the coverage (mostly on the python 3 side, and
using more consistent dependencies throughout) and move the 3.x tests
that don't care about a specific 3.x version to 3.3.
This is still less thorough than the travis.yml, which runs everything for
every python version.
Gavin M. Roy [Mon, 6 Jan 2014 21:47:54 +0000 (16:47 -0500)]
Don't call logging.basicConfig if logging is already configured (#775).
Will not call logging.basicConfig if there is a root logger,
tornado logger or tornado.application logger.
Updated patch to reflect comments about tests and method privacy.