Ilya Kulakov

Results 232 comments of Ilya Kulakov

> I also have concerns with the use of gc.collect(): how does collecting a pending task raises an exception? I don't think we should rely on this. These are details...

Not sure I understood @vstinner comment. We are trying to come up with a solution to check if there are tasks with pending exceptions by the time the test is...

@1st1 We do not control the flow within a test case. Tasks with unhandled exceptions can be deleted before the execution will reach our code. These deleted tasks won't appear...

But again, warnings are issued upon object's destruction which may or may not happen and therefore usage of `gc.collect` is inevitable.

@1st1 Pushed one more attempt of an implementation that avoids `gc.collect`. One issue though is that context passed to [custom exception handler](https://github.com/Martiusweb/asynctest/pull/60/files#diff-a3f93a9b883358aaeb574566aa4a911fR248) does not receive `source_traceback`. Neither `Task._log_traceback` is set.

With the [async_timeout](https://github.com/aio-libs/async-timeout/tree/master/async_timeout) package decorator could be implemented like this: ```python ... DEFAULT_ASYNC_TIMEOUT = 1.0 @classmethod def with_timeout(cls, timeout=None): if timeout is None: timeout = cls.DEFAULT_ASYNC_TIMEOUT def decorator(coro): @functools.wraps(coro) async...

@Martiusweb I think we can fix this behavior by: 1. Changing [`proxy`](https://github.com/Martiusweb/asynctest/blob/master/asynctest/mock.py#L554-L565) to a class with attributes for `result` and `_call` 2. Instantiating it just once per mock

Alternatively a custom attribute can be added to each instance of proxy with a consistent value (e.g. `id(self)`) so it would be possible to distinguish it while checking `ensure_future`'s arguments....

How would you test against the following cases: - Assuming you have a buggy code that schedules the awaitable twice instead of just once - An "ensured" future that is...

We could track the lifetime of all coroutines and capture it in a digraph (e.g. via the networkx library). The nodes of such digraph would be: - call objects (construction...