Commit Graph

2061 Commits

Author SHA1 Message Date
bdarnell c20ab3547d Merge pull request #1023 from zakkie/feature/fix-testcase
put assertion outside of the exception handler
2014-03-31 10:54:15 -04:00
Akihiro Yamazaki 32c7a328ed correct testcases 2014-03-30 23:15:46 +09:00
Akihiro Yamazaki e914a5143e use "with self.assertRaises" pattern 2014-03-28 09:10:58 +09:00
Akihiro Yamazaki ccbe5a2787 put assertion outside of the exception handler 2014-03-27 09:37:29 +09:00
bdarnell 7508e216d0 Merge pull request #1022 from shinriyo/master
tab to space
2014-03-25 21:56:01 -04:00
shinriyo 142b5fb92f tab to space
tab to space and indent fix
2014-03-26 10:04:07 +09:00
bdarnell b5b2132771 Merge pull request #1020 from dhcmrlchtdj/fix-template-doc
Fix a mistake in template document.
2014-03-23 21:28:29 -04:00
huangxiaokai 958c3f322c Fix a mistake in template document. 2014-03-23 18:25:25 +08:00
bdarnell 4b8a9943ac Merge pull request #1019 from minrk/clear_instance
add IOLoop.clear_instance
2014-03-22 13:20:06 -04:00
MinRK dd45026300 add IOLoop.clear_instance
like clear_current, but for the global IOLoop instance
2014-03-21 10:59:25 -07:00
Ben Darnell 4ff47bb486 Update links for comments about json list output.
The vulnerability in the older link affects only ancient browsers,
but there are other issues that are more recent.

Fixes #1009.
2014-03-15 00:50:25 -04:00
Ben Darnell 99474fe89b 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.

Fixes #1005.
2014-03-15 00:46:52 -04:00
Ben Darnell d2226ff81b 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.

Closes #1014.
2014-03-13 10:15:41 -04:00
Ben Darnell 2aef15dfa3 Fix command-line tornado.httpclient on python 3. 2014-03-13 10:04:36 -04:00
bdarnell 180e8186ca Merge pull request #1012 from dlutxx/br310
remove a redundant assignment in read_until_close.
2014-03-11 00:09:28 -04:00
bdarnell f1f66d1b28 Merge pull request #1008 from yaccz/fix/1007
twisted can be installed without twisted.names fixes #1007
2014-03-10 22:32:17 -04:00
xuxiang 1759dc694a remove useless code of BaseIOStream 2014-03-10 18:22:39 +08:00
yac a749b999ad
twisted can be installed without twisted.names fixes #1007 2014-03-08 01:20:09 +01:00
bdarnell b1f5cc59be Merge pull request #996 from cardoe/exception-fix
use errno attr instead of index into args for errno
2014-03-03 10:59:18 -05:00
Ben Darnell d4627e09bd Exclude another timing-sensitive test from the travis build. 2014-03-02 11:06:06 -05:00
bdarnell e52db2f110 Merge pull request #999 from mengzhuo/master
update Template Loader with 'with' statement
2014-03-02 11:03:29 -05:00
Meng Zhuo 41a8f1a393 update Template Loader with 'with' statment 2014-03-02 22:20:49 +08:00
Doug Goldstein f81a25e177 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.
2014-03-01 14:22:20 -06:00
Ben Darnell 824226d71b Fix bit-rotted app engine tests.
sys.argv is no longer empty in dev_appserver.
2014-02-23 12:49:11 -05:00
Ben Darnell f55f9d0745 Add a warning label to WSGIContainer. 2014-02-22 23:25:51 -05:00
Ben Darnell 559514de8c Disable port-allocation test on mac to avoid annoying firewall prompts. 2014-02-21 20:42:10 -05:00
bdarnell 2ad4a90845 Merge pull request #977 from schlamar/fix-port-allocation
Fixed automatic port allocation in bind_sockets.
2014-02-21 20:27:30 -05:00
schlamar 151eef74a4 Fixed automatic port allocation in bind_sockets.
bind_sockets should use the same port on IPv4 and IPv6 if port=None.
2014-02-21 13:06:55 +01:00
Ben Darnell b9c6c33e45 Catch up on next-release notes. 2014-02-18 23:52:58 -05:00
Ben Darnell 2dc57c57b1 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.

Closes #952.
2014-02-18 23:35:55 -05:00
Ben Darnell 1eb003f2da Add python 3.4 tests to tox 2014-02-18 00:08:09 -05:00
Ben Darnell 58d5ffc26b Add support for the websocket close status code and reason fields.
Closes #890.
2014-02-17 18:46:40 -05:00
Ben Darnell 175da1055a Compress all text/* content types, not just a whitelist.
Closes #982.
2014-02-16 23:59:17 -05:00
Ben Darnell f2cae31d18 Add a py26-trollius test case and fix a bug with timedelta on 2.6. 2014-02-16 23:41:15 -05:00
Ben Darnell 47c7f63f24 Add a fast path to stack_context when there are no active contexts.
This case is increasingly common now that coroutines are decoupled
from stack contexts.
2014-02-16 23:06:18 -05:00
Ben Darnell 5c32f9d11f Remove _iostream_return_future from write and connect as well. 2014-02-16 22:05:55 -05:00
Ben Darnell 1653350825 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.
2014-02-16 21:49:22 -05:00
Ben Darnell 7aa1de9fd9 Microoptimizations for coroutines
* Lazily initialize data structures for YieldPoints
* Get rid of Runner.exc_info
2014-02-16 20:44:43 -05:00
Ben Darnell 8e07f3d865 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.

Also microoptimized a few methods of Future.
2014-02-16 20:29:37 -05:00
Ben Darnell 184d796b67 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.
2014-01-26 20:06:28 -05:00
Ben Darnell 71158fe8ba 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.
2014-01-26 19:45:50 -05:00
Ben Darnell 0ea4de346d gen.Runner now communicates back to the decorator via a Future instead of a callback.
This allows for failures to be reported without relying on stack_context.
2014-01-26 15:25:10 -05:00
Ben Darnell b2ee332165 Consolidate implementations of gen.engine and gen.coroutine.
The shared implementation is nearly identical to the old gen.coroutine,
with a small tweak for the callback argument.
2014-01-26 15:16:36 -05:00
Ben Darnell 9cf95ff7eb 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.
2014-01-25 22:43:42 -05:00
Ben Darnell dce2ffe1b3 tornado.concurrent.Future is now always thread-unsafe.
This improves performance and provides more consistent semantics
(independent of the presence or absence of the concurrent.futures
package).

The parts of Tornado that accept Futures will accept both Tornado's
thread-unsafe Futures and the thread-safe concurrent.futures.Future.
2014-01-25 22:18:08 -05:00
Ben Darnell b1482368b1 Add a benchmark for coroutine processing. 2014-01-25 21:55:39 -05:00
Ben Darnell d0ee6db9fd Improve the stack traces given for timeouts with @gen_test. 2014-01-25 18:15:55 -05:00
Ben Darnell 869fb744db Raise an error if IOLoop.start() is called while it is already running. 2014-01-25 17:16:17 -05:00
Ben Darnell 8069428934 Add support in AsyncTestCase for detecting undecorated generators.
Fix a test that was not being run because of this issue.
2014-01-25 13:43:27 -05:00
bdarnell b1ff5391d8 Merge pull request #979 from mike4999/simple_fix
Fix for RequestHandler.write   to check for NoneType in argument
2014-01-24 17:59:44 -08:00