Terry Jan Reedy [Tue, 1 Jul 2014 03:52:20 +0000 (23:52 -0400)]
Issue #18592: Refactor 2 SearchDialogBase.create_(option/other)_buttons methods
to remove duplication and return info for tests. Rewrite corresponding tests.
Test_create_option_buttons was not testing anything because of buggy
comparisons. Use Python subscripting to get widget options.
Victor Stinner [Mon, 30 Jun 2014 12:51:04 +0000 (14:51 +0200)]
Issue #21163: BaseEventLoop.run_until_complete() and test_utils.run_briefly()
don't log the "destroy pending task" message anymore. The log is redundant for
run_until_complete() and useless in run_briefly().
Victor Stinner [Mon, 30 Jun 2014 12:39:11 +0000 (14:39 +0200)]
asyncio: sync with Tulip
- Sort imports
- Simplify/optimize iscoroutine(). Inline inspect.isgenerator(obj): replace it
with isinstance(obj, types.GeneratorType)
- CoroWrapper: check at runtime if Python has the yield-from bug #21209. If
Python has the bug, check if CoroWrapper.send() was called by yield-from to
decide if parameters must be unpacked or not.
- Fix "Task was destroyed but it is pending!" warning in
test_task_source_traceback()
Victor Stinner [Fri, 27 Jun 2014 21:52:03 +0000 (23:52 +0200)]
Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
object is destroyed. The destructor now closes the file if needed. The close()
method can now be called twice: the second call does nothing.
Victor Stinner [Fri, 27 Jun 2014 11:52:20 +0000 (13:52 +0200)]
asyncio, Tulip issue 137: In debug mode, save traceback where Future, Task and
Handle objects are created. Pass the traceback to call_exception_handler() in
the 'source_traceback' key.
The traceback is truncated to hide internal calls in asyncio, show only the
traceback from user code.
Add tests for the new source_traceback, and a test for the 'Future/Task
exception was never retrieved' log.
Victor Stinner [Wed, 25 Jun 2014 21:32:25 +0000 (23:32 +0200)]
asyncio: sync with Tulip
- Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in
tests
- Add test to check that run_until_complete() checks the loop of the future
Senthil Kumaran [Wed, 25 Jun 2014 09:58:15 +0000 (02:58 -0700)]
issue20753 - robotparser tests should not rely upon external resource when not required.
Specifically, it was relying a URL which gave HTTP 403 and used it to assert
it's methods, this changes undoes that and provides a local http server with
similar properties.
Victor Stinner [Tue, 24 Jun 2014 20:57:14 +0000 (22:57 +0200)]
asyncio: repr(Task) now also contains the line number even if the coroutine is
done: use the first line number of the code object instead of the current line
number of the generator frame.
The name of the coroutine is not enough because many coroutines may have the
same name. It's a common case in asyncio tests for example.
Victor Stinner [Sun, 22 Jun 2014 23:02:37 +0000 (01:02 +0200)]
asyncio, Tulip issue 171: BaseEventLoop.close() now raises an exception if the
event loop is running. You must first stop the event loop and then wait until
it stopped, before closing it.
Victor Stinner [Sun, 22 Jun 2014 22:03:43 +0000 (00:03 +0200)]
asyncio: BaseEventLoop._assert_is_current_event_loop() now only raises an
exception if the current loop is not None.
Guido van Rossum wrote:
"The behavior that you can set the loop to None (and keep track of it
explicitly) is part of the spec, and this should still be supported even in
debug mode. The behavior that we raise an error if you are caught having
multiple active loops per thread is just a debugging heuristic, and it
shouldn't break code that follows the spec."
Victor Stinner [Thu, 19 Jun 2014 10:59:15 +0000 (12:59 +0200)]
Closes #21595: asyncio.BaseSelectorEventLoop._read_from_self() now reads all
available bytes from the "self pipe", not only a single byte. This change
reduces the risk of having the pipe full and so getting the innocuous
"BlockingIOError: [Errno 11] Resource temporarily unavailable" message.
Victor Stinner [Tue, 17 Jun 2014 23:22:15 +0000 (01:22 +0200)]
asyncio: Refactor test__run_once_logging() to not rely on the exact number of
calls to time.monotonic(). Use a "fast select" and a "slow select" instead.
Victor Stinner [Tue, 17 Jun 2014 23:14:59 +0000 (01:14 +0200)]
asyncio: Set __qualname__ attribute of CoroWrapper in @coroutine decorator on
Python 3.5
- Drop __slots__ optimization of CoroWrapper to be able to set the __qualname__
attribute.
- Add tests on __name__, __qualname__ and __module__ of a coroutine function
and coroutine object.
- Fix test_tasks when run in debug mode (PYTHONASYNCIODEBUG env var set) on
Python 3.3 or 3.4