[issue35767] unittest loader doesn't work with partial test functions

2020-09-22 Thread Jason Fried
Change by Jason Fried : -- resolution: -> fixed ___ Python tracker <https://bugs.python.org/issue35767> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue35767] unittest loader doesn't work with partial test functions

2020-09-22 Thread Jason Fried
Change by Jason Fried : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35767> ___ ___ Pyth

[issue38857] AsyncMock issue with awaitable return_value/side_effect/wraps

2020-02-17 Thread Jason Fried
Jason Fried added the comment: Its not possible to have it both ways. Also it stinks too much of trying to guess. The root of your issue is you want a normal MagicMock not an AsyncMock. Its the automatic behavior of patch to pick AsyncMock vs MagicMock that is the heart of your issue

[issue38859] AsyncMock says it raises StopIteration but that is Impossible

2019-11-19 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch pull_requests: +16762 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17269 ___ Python tracker <https://bugs.python.org/issu

[issue38857] AsyncMock issue with awaitable return_value/side_effect/wraps

2019-11-19 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch pull_requests: +16761 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17269 ___ Python tracker <https://bugs.python.org/issu

[issue38857] AsyncMock issue with awaitable return_value/side_effect/wraps

2019-11-19 Thread Jason Fried
Change by Jason Fried : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue38857> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue38859] AsyncMock says it raises StopIteration but that is Impossible

2019-11-19 Thread Jason Fried
New submission from Jason Fried : If an AsyncMock uses a side_effect that is an Iterable, if called more than items exist its suppose to raise StopIteration according to the docs but PEP 479 says that is impossible. My Suggestion is that we update the docs and the code to Raise

[issue38857] AsyncMock issue with awaitable return_value/side_effect/wraps

2019-11-19 Thread Jason Fried
New submission from Jason Fried : If you are trying to use AsyncMock to mock a coroutine that returns awaitable objects, AsyncMock awaits on those objects instead of returning them as is. Example: mock = AsyncMock(return_value=asyncio.Future()) v = await mock() # blocks on trying

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2019-10-08 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch pull_requests: +16250 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16667 ___ Python tracker <https://bugs.python.org/issu

[issue38415] @asynccontextmanager decorated functions are not callable like @contextmanager

2019-10-08 Thread Jason Fried
New submission from Jason Fried : The standard contextmanager decorator produces a wrapper that itself can be used as a decorator ``` @contextmanager def some_context(): ... yield @some_context() def some_function(): # we are inside a with some_context() now. ... ``` When

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2019-08-26 Thread Jason Fried
Jason Fried added the comment: Yeah I have to agree at this point, from a naive point of view it looks awesome, but its just as bad as loosing gil guarantees. On Mon, Aug 26, 2019 at 03:04 Andrew Svetlov wrote: > > Andrew Svetlov added the comment: > > The solution pro

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch, patch, patch pull_requests: +11316, 11317, 11318 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch pull_requests: +11316 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35767> ___ ___ Py

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
Change by Jason Fried : -- keywords: +patch, patch pull_requests: +11316, 11317 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
Jason Fried added the comment: working on a pull request -- ___ Python tracker <https://bugs.python.org/issue35767> ___ ___ Python-bugs-list mailing list Unsub

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
Jason Fried added the comment: Oh this is broken in 3.7 trunk -- ___ Python tracker <https://bugs.python.org/issue35767> ___ ___ Python-bugs-list mailin

[issue35767] unittest loader doesn't work with partial test functions

2019-01-17 Thread Jason Fried
New submission from Jason Fried : https://github.com/python/cpython/blob/3.7/Lib/unittest/loader.py#L232 fullName = '%s.%s' % (testCaseClass.__module__, testFunc.__qualname__) Instead we should probably replace testFunc.__qualname__ with attrname I ran into this while running a test suite

[issue33864] collections.abc.ByteString does not register memoryview

2018-06-14 Thread Jason Fried
New submission from Jason Fried : Looking at the typing Module docs in the section for ByteString This type represents the types bytes, bytearray, and memoryview. But collections.abc.ByteString does not have memoryview registered. Is it because memoryview doesn't support .index

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2018-05-21 Thread Jason Fried
Jason Fried <m...@jasonfried.info> added the comment: For loops not supporting this throwing NotImplmentedError from the method to enable reentrancy seems appropriate. "You should convert all your stack to async functions..." That may not be practical for large code bas

[issue33546] asyncio.Condition should become awaitable in 3.9

2018-05-16 Thread Jason Fried
New submission from Jason Fried <m...@jasonfried.info>: In 3.9 we can remove the deprecated pattern for accepting __enter__ and __exit__ for locks. This will free up __await__ for Condition to use for replacing .wait() which is wart from before awaitables. My new proposed behavior is

[issue33544] Asyncio Event.wait() is a hold over from before awaitable, and should be awaitable

2018-05-16 Thread Jason Fried
Change by Jason Fried <m...@jasonfried.info>: -- keywords: +patch pull_requests: +6584 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33544] Asyncio Event.wait() is a hold over from before awaitable, and should be awaitable

2018-05-16 Thread Jason Fried
Jason Fried <m...@jasonfried.info> added the comment: Removed Condition from this request, because it has an __await__ method for supporting the the deprecated pattern with async cond: I'll open a different bug, for Condition behavior for 3.9 when we can remove the deprecated p

[issue33544] Asyncio Event.wait() and Condition.wait() is a hold over from before awaitable, and should be awaitable

2018-05-16 Thread Jason Fried
New submission from Jason Fried <m...@jasonfried.info>: wait is a very overloaded word in asyncio. Events and Conditions are not consistent with the rest of asyncio. Why don't Future and Task have wait() methods? well because they are awaitable Some subjective reasoning: Every tim

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2018-05-15 Thread Jason Fried
Change by Jason Fried <m...@jasonfried.info>: -- keywords: +patch pull_requests: +6540 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2018-05-15 Thread Jason Fried
Change by Jason Fried <m...@jasonfried.info>: -- nosy: +lukasz.langa ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33523> ___ _

[issue33523] loop.run_until_complete re-entrancy to support more complicated codebases in transition to asyncio

2018-05-15 Thread Jason Fried
New submission from Jason Fried <m...@jasonfried.info>: At Facebook and Instagram we have large interconnected codebases without clear boundaries of ownership. As we move more and more services to utilize asyncio we are finding that once blocking (but fast) code paths, are now cropp

[issue30395] deadlocked child process after forking on pystate.c's head_mutex

2017-05-22 Thread Jason Fried
Changes by Jason Fried <m...@jasonfried.info>: -- pull_requests: +1825 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30395> ___ _

[issue27199] TarFile expose copyfileobj bufsize to improve throughput

2016-06-03 Thread Jason Fried
Changes by Jason Fried <m...@jasonfried.info>: -- keywords: +patch Added file: http://bugs.python.org/file43159/copybufsize.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27199] TarFile expose copyfileobj bufsize to improve throughput

2016-06-03 Thread Jason Fried
New submission from Jason Fried: The default of 16k while good for memory usage it is not well suited for all cases. if we increased this to 4MB we saw a pretty large improvement to tar file creation and extraction on linux servers. For a 1gb tar file containing 1024 random files each of 10MB

[issue27194] Tarfile superfluous truncate calls slows extraction.

2016-06-02 Thread Jason Fried
Jason Fried added the comment: I ran this on Linux ext4. I didn't see much improvement on OSX with SSD. -- Added file: http://bugs.python.org/file43139/test.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27194] Tarfile superfluous truncate calls slows extraction.

2016-06-02 Thread Jason Fried
New submission from Jason Fried: With large tar file extracts I noticed that tarfile was slower than it should be. Seems in linux that for large files (10MB) truncate is not always a free operation even when it should be a no-op. ex: File is already 10mb seek to end and truncate. I created