[issue42159] AsyncMock restores stopped patch if same object stopped multiple times

2020-10-26 Thread Lisa Roach
New submission from Lisa Roach : Hard to explain in the title, easier to see via a test case: async def async_func(): raise Exception def test_simultaneous_mocks(self): class Test(IsolatedAsyncioTestCase): async def test_test(self

[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-26 Thread Lisa Roach
Lisa Roach added the comment: New changeset 8374d2ee1589791be8892b00f4bbf8121dde24bd by Lisa Roach in branch 'master': bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654) https://github.com/python/cpython/commit/8374d2ee1589791be8892b00f4bbf8121dde24bd

[issue39706] unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError

2020-10-26 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39706] unittest.IsolatedAsyncioTestCase hangs on asyncio.CancelledError

2020-10-26 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch nosy: +lisroach nosy_count: 3.0 -> 4.0 pull_requests: +21902 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22654 ___ Python tracker <https://bugs.python.org/i

[issue42072] requests

2020-10-19 Thread Lisa Roach
Lisa Roach added the comment: Requests is a third-party library (https://pypi.org/project/requests/2.7.0/), it is not a part of CPython so this is not the correct forum to report bugs. They have their own issue tracker here: https://github.com/psf/requests/issues I'd also suggest

[issue41954] [mock] Recursion on mocking inspect.isfunction

2020-10-19 Thread Lisa Roach
Lisa Roach added the comment: Oof yeah, sorry my commit broke this but it is pretty hard to avoid. Mario is right in that it would be messy and challenging to ensure anything mocked from the stdlib doesn't also break mock itself. I want to mark this as `wont fix`, unless

[issue42038] Tracemalloc's format() doc contradictory

2020-10-14 Thread Lisa Roach
New submission from Lisa Roach : Tracemalloc's format documentation (https://docs.python.org/3/library/tracemalloc.html#tracemalloc.Traceback.format) says first: "Format the traceback as a list of lines with newlines." then: "Similar to the traceback.format_tb() f

[issue42038] Tracemalloc's format() doc contradictory

2020-10-14 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +easy, newcomer friendly ___ Python tracker <https://bugs.python.org/issue42038> ___ ___ Python-bugs-list mailing list Unsub

[issue39101] IsolatedAsyncioTestCase freezes when exception is raised

2020-10-11 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch nosy: +lisroach nosy_count: 3.0 -> 4.0 pull_requests: +21630 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22654 ___ Python tracker <https://bugs.python.org/i

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

2019-11-21 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2019-11-21 Thread Lisa Roach
Lisa Roach added the comment: PR merged, thanks Jason! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

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

2019-11-20 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +16796 pull_request: https://github.com/python/cpython/pull/17304 ___ Python tracker <https://bugs.python.org/issue38

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

2019-11-20 Thread Lisa Roach
Lisa Roach added the comment: New changeset 046442d02bcc6e848e71e93e47f6cde9e279e993 by Lisa Roach (Jason Fried) in branch 'master': bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) https://github.com/python/cpython/commit

[issue38753] AsyncMock not cited as new in 3.8

2019-11-19 Thread Lisa Roach
Lisa Roach added the comment: New changeset 279d8df5e5e8bbd4429420649359f7afcb4c8cce by Lisa Roach (John Belmonte) in branch 'master': bpo-38753: AsyncMock added in version 3.8 (GH-17102) https://github.com/python/cpython/commit/279d8df5e5e8bbd4429420649359f7afcb4c8cce

[issue38163] AsyncMock child mocks should detect their type

2019-09-29 Thread Lisa Roach
Lisa Roach added the comment: New changeset 21f24ead90c22d0e2c2ebf14a64b37d99de54b33 by Lisa Roach in branch '3.8': [3.8] bpo-38163: Child mocks detect their type as sync or async (GH-16471) (GH-16484) https://github.com/python/cpython/commit/21f24ead90c22d0e2c2ebf14a64b37d99de54b33

[issue38163] AsyncMock child mocks should detect their type

2019-09-29 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38163] AsyncMock child mocks should detect their type

2019-09-29 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +16069 pull_request: https://github.com/python/cpython/pull/16484 ___ Python tracker <https://bugs.python.org/issue38

[issue38163] AsyncMock child mocks should detect their type

2019-09-29 Thread Lisa Roach
Lisa Roach added the comment: New changeset 3667e1ee6c90e6d3b6a745cd590ece87118f81ad by Lisa Roach in branch 'master': bpo-38163: Child mocks detect their type as sync or async (GH-16471) https://github.com/python/cpython/commit/3667e1ee6c90e6d3b6a745cd590ece87118f81ad

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-29 Thread Lisa Roach
Lisa Roach added the comment: New changeset 36e7e4aabb662e86e9dace1a6447492f45868654 by Lisa Roach (Miss Islington (bot)) in branch '3.8': bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) (GH-16481) https://github.com/python/cpython/commit/36e7e4aabb662e86e9dace1a6447492f45868654

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-29 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-29 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38108] Everything in Mock should inherit from Base

2019-09-29 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38108] Everything in Mock should inherit from Base

2019-09-29 Thread Lisa Roach
Lisa Roach added the comment: New changeset b76ab352405df105c2d459fc66ef8dc98e47b37c by Lisa Roach (Miss Islington (bot)) in branch '3.8': bpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470) https://github.com/python/cpython/commit/b76ab352405df105c2d459fc66ef8dc98e47b37c

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-29 Thread Lisa Roach
Lisa Roach added the comment: New changeset 25e115ec00b5f75e3589c9f21013c47c21e1753f by Lisa Roach in branch 'master': bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) https://github.com/python/cpython/commit/25e115ec00b5f75e3589c9f21013c47c21e1753f

[issue38163] AsyncMock child mocks should detect their type

2019-09-28 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +16054 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16471 ___ Python tracker <https://bugs.python.org/issu

[issue38108] Everything in Mock should inherit from Base

2019-09-28 Thread Lisa Roach
Lisa Roach added the comment: New changeset 9a7d9519506ae807ca48ff02e2ea117ebac3450e by Lisa Roach in branch 'master': bpo-38108: Makes mock objects inherit from Base (GH-16060) https://github.com/python/cpython/commit/9a7d9519506ae807ca48ff02e2ea117ebac3450e

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-27 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +16023 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16443 ___ Python tracker <https://bugs.python.org/issu

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-27 Thread Lisa Roach
Lisa Roach added the comment: Looking at this more, I think I want to just remove the current `awaited` object. The PR in asyntest makes it seem pretty cool: https://github.com/Martiusweb/asynctest/issues/64 But I have issue with the naming (await_event is probably better for us), and I'm

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-27 Thread Lisa Roach
Lisa Roach added the comment: New changeset 52bdd414ed9da7c62c312c542803753986a0040a by Lisa Roach in branch '3.8': [3.8] bpo-38136: Updates await_count and call_count to be different things (GH-16192) (GH-16431) https://github.com/python/cpython/commit

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-26 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +16010 pull_request: https://github.com/python/cpython/pull/16431 ___ Python tracker <https://bugs.python.org/issue38

[issue38163] AsyncMock child mocks should detect their type

2019-09-25 Thread Lisa Roach
Lisa Roach added the comment: Lately I have been having my doubts around having MagicMocks also create AsyncMocks as children. Should a MagicMock really have a __aenter__ magic method? Is this too far from the original MagicMock if we change child mocks to default not to their parent type

[issue38163] AsyncMock child mocks should detect their type

2019-09-25 Thread Lisa Roach
Lisa Roach added the comment: This should be simple to do, after https://github.com/python/cpython/pull/16060 we can add: elif self._mock_methods and _new_name in self._mock_methods: # Methods that are not in _spec_asyncs are normal methods klass

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-23 Thread Lisa Roach
Lisa Roach added the comment: New changeset ef048517755db1f0d211fb6dfc655a8b412cc96f by Lisa Roach in branch 'master': bpo-38136: Updates await_count and call_count to be different things (GH-16192) https://github.com/python/cpython/commit/ef048517755db1f0d211fb6dfc655a8b412cc96f

[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-20 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +15885 pull_request: https://github.com/python/cpython/pull/16299 ___ Python tracker <https://bugs.python.org/issue38

[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-19 Thread Lisa Roach
Lisa Roach added the comment: New changeset 8b03f943c37e07fb2394acdcfacd066647f9b1fd by Lisa Roach in branch 'master': bpo-38093: Correctly returns AsyncMock for async subclasses. (GH-15947) https://github.com/python/cpython/commit/8b03f943c37e07fb2394acdcfacd066647f9b1fd

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-19 Thread Lisa Roach
Lisa Roach added the comment: Yeah I think the current `awaited` ought to at least be a private variable, since people will assume it works like a boolean to match `.called`. Then we could add a new, proper, `awaited` that would function like: >>> mock = AsyncMock() >>&

[issue38100] Spelling error in unittest.mock code

2019-09-16 Thread Lisa Roach
Lisa Roach added the comment: (y) Thanks for looking into it Stéphane! -- ___ Python tracker <https://bugs.python.org/issue38100> ___ ___ Python-bugs-list mailin

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-16 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +15798 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16192 ___ Python tracker <https://bugs.python.org/issu

[issue38100] Spelling error in unittest.mock code

2019-09-16 Thread Lisa Roach
Lisa Roach added the comment: It helps to comment on the issue before making a PR for it to claim it, as now we have 3 PRs all for the same issue :) We will likely accept the first PR that was created (or in this case the first PR that gets a CLA signed

[issue38163] AsyncMock child mocks should detect their type

2019-09-13 Thread Lisa Roach
New submission from Lisa Roach : We want child mocks to match their "type" (async or sync). Ex: class Prod: async def foo(): pass def bar(): pass a_mock = AsyncMock(Prod) isinstance(a_mock.foo(), AsyncMock) == True isinstance(a_mock.bar(), MagicMock) ==

[issue38161] AsyncMock add `.awaited` like `.called`

2019-09-13 Thread Lisa Roach
New submission from Lisa Roach : Currently Mock has a `.called` attribute, we could add an equivalent `.awaited` that returns True or False if the object has been awaited on. -- messages: 352345 nosy: lisroach priority: normal severity: normal status: open title: AsyncMock add

[issue17013] Allow waiting on a mock

2019-09-12 Thread Lisa Roach
Change by Lisa Roach : -- nosy: +lisroach ___ Python tracker <https://bugs.python.org/issue17013> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38108] Everything in Mock should inherit from Base

2019-09-12 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +15683 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16060 ___ Python tracker <https://bugs.python.org/issu

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-12 Thread Lisa Roach
Lisa Roach added the comment: Going to try to recap an in-person conversation: There are some cases where calls are made separate from when they are awaited, for example: >>> call = foo() >>> await call This would be 1 call and 1 await: Call

[issue38136] Remove AsyncMock.assert_awaited_*

2019-09-12 Thread Lisa Roach
New submission from Lisa Roach : After some discussion about call_count vs await_count, I believe call_count should be counting when things are *awaited* (await foo()), not when they are *called* (foo()). I think people expect "calling" to execute the code and give them a re

[issue38122] AsyncMock force always creating an AsyncMock for child mocks

2019-09-11 Thread Lisa Roach
New submission from Lisa Roach : This idea has been brought up in person before and also discussed on AsyncTest: https://github.com/Martiusweb/asynctest/issues/100 It could be useful if someone has a lot of attributes that are also async that need to be mocked. It could probably be done

[issue38108] Everything in Mock should inherit from Base

2019-09-11 Thread Lisa Roach
Lisa Roach added the comment: Also: _AsyncIterator _AwaitEvent Some of the code in AsyncMagicMixin might be able to be simplified if we inherit from MagicMixin instead, right now we might be duplicating work. In general we have to watch out for duplication/overwriting of attributes

[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-11 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +15582 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15947 ___ Python tracker <https://bugs.python.org/issu

[issue38108] Everything in Mock should inherit from Base

2019-09-11 Thread Lisa Roach
New submission from Lisa Roach : Everything within Mock should be inheriting from the top-level parent class, Base (and properly call super). For multiple inheritance to work correctly they all should be inheriting from the same parent class ultimately. Classes that need update

[issue38103] Duplicate label "examples" in the Docs

2019-09-11 Thread Lisa Roach
Lisa Roach added the comment: New changeset 2d8d597bb8f882a7677db5a2739df0e617098634 by Lisa Roach (Ezio Melotti) in branch 'master': bpo-38103: fix conflicting labels in the docs. (GH-15906) https://github.com/python/cpython/commit/2d8d597bb8f882a7677db5a2739df0e617098634 -- nosy

[issue38101] Update devguide triaging keywords

2019-09-11 Thread Lisa Roach
New submission from Lisa Roach : Currently the devguide triaging keywords page is out of date: https://devguide.python.org/triaging/#keywords It is missing keywords like "easy (C)", "security_issue", and "pep3121". -- assignee: docs@python components

[issue38100] Spelling error in unittest.mock code

2019-09-11 Thread Lisa Roach
New submission from Lisa Roach : Good first issue. There is a spelling error in the unittest.mock library, "return_calulator" should be "return_calculator". This is in the `_set_return_value` method in `Lib/unittest/mock.py`. -- components: Library (Lib) keyw

[issue38093] Update MagicMock __aenter__ and __aexit__ to return AsyncMock's

2019-09-10 Thread Lisa Roach
New submission from Lisa Roach : After a discussion with Michael, xtreak, and Ezio we've decided to try to make the process of mocking an async context manager slightly easier. Currently if you want to mock a context manager that is used like this: async with cm(): # note that cm is called

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-09-10 Thread Lisa Roach
Change by Lisa Roach : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-09-10 Thread Lisa Roach
Lisa Roach added the comment: New changeset f1a297acb60b88917712450ebd3cfa707e6efd6b by Lisa Roach in branch 'master': bpo-37251: Removes __code__ check from _is_async_obj. (GH-15830) https://github.com/python/cpython/commit/f1a297acb60b88917712450ebd3cfa707e6efd6b

[issue37052] Add examples for mocking async for and async context manager in unittest.mock docs

2019-09-10 Thread Lisa Roach
Lisa Roach added the comment: I think this is a great addition! Ezio and I were chatting about trying to add an example where the child mocks are also AsyncMocks, since by default they will be MagicMocks. Adding him to nosy. -- nosy: +ezio.melotti

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-09-10 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +15476 pull_request: https://github.com/python/cpython/pull/15830 ___ Python tracker <https://bugs.python.org/issue37

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: New changeset b9f65f01fd761da7799f36d29b54518399d3458e by Lisa Roach in branch 'master': bpo-37383: Updates docs to reflect AsyncMock call_count after await. (#15761) https://github.com/python/cpython/commit/b9f65f01fd761da7799f36d29b54518399d3458e

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: Oh nice, I remember talking to you about the MultiError before, it will help simplify some Mock things. Happy to help out if you want more eyes on it. On Mon, Sep 9, 2019 at 3:46 PM Yury Selivanov wrote: > > Yury Selivanov added the comment: > > FW

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: Sounds good, thanks for the explanation Yury. I look forward to the TaskGroups! -- ___ Python tracker <https://bugs.python.org/issue30

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: I would like to see this implemented. I run into memory and speed issues when running with 1000+ tasks quite frequently, and have to write my own rate limiters around it. It doesn't look to me that it is adding a large amount of complexity to as_completed

[issue38054] enhance pdb.set_trace() to run when the specified condition is true

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: Does this flag make things much easier? You would still need an if statement in order to correctly pass in True/False for the trigger flag. -- nosy: +lisroach ___ Python tracker <https://bugs.python.org/issue38

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +15414 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15761 ___ Python tracker <https://bugs.python.org/issu

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: I think you are right, I'd prefer to leave it in. It also helps users who are switching from AsyncTest to the std lib AsyncMock, they can keep using `await_count`. I'll update the docs! -- ___ Python tracker <ht

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: I wonder if `await_count` is really necessary, since it is essentially the same as `call_count`. Would it be too late or confusing to remove it now? -- ___ Python tracker <https://bugs.python.org/issue37

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: Agreed, I think documentation can be clearer around this. I'll add a PR to try to clarify. -- ___ Python tracker <https://bugs.python.org/issue37

[issue37383] call count in not registered in AsyncMock till the coroutine is awaited

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: I see your point it is confusing the difference between the async and sync API, but I think the current AsyncMock call check is correct. According to the asyncio docs: "...simply calling a coroutine will not schedule it to be executed" (https://docs.

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-09-09 Thread Lisa Roach
Lisa Roach added the comment: I made a new branch with the changes I am suggesting here to try to be more clear: https://github.com/lisroach/cpython/tree/issue37251 What do you think? -- ___ Python tracker <https://bugs.python.org/issue37

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-06-25 Thread Lisa Roach
Lisa Roach added the comment: Yes, sorry I wasn't clear, I was thinking about the functions and testing without your PR. I think removing the __code__ object (or working around it) is the correct way to go, but just removing it wouldn't solve this particular problem. "If I under

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-06-19 Thread Lisa Roach
Lisa Roach added the comment: Thanks for the patch! To answer your question, I do not think we can remove _is_async_func in favor of _is_async_obj, _is_async_obj will evaluate to True in cases where _is_async_func would not. For example: >>> class NewCoroutine(Awaitable): ..

[issue37251] Mocking a MagicMock with a function spec results in an AsyncMock

2019-06-12 Thread Lisa Roach
Lisa Roach added the comment: Following up from xtreak's proposal (https://github.com/python/cpython/pull/9296) I think checking if __code__ is actually a CodeType is a good idea. It's simple and doesn't change any other functionality in an unwanted way

[issue24412] setUpClass equivalent for addCleanup

2019-06-10 Thread Lisa Roach
Change by Lisa Roach : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue24412> ___ ___ Pyth

[issue36996] unittest.mock.patch decorator doesn't work with async functions

2019-05-21 Thread Lisa Roach
Lisa Roach added the comment: Oops, didn't see your post. Thanks! -- ___ Python tracker <https://bugs.python.org/issue36996> ___ ___ Python-bugs-list mailin

[issue36996] unittest.mock.patch decorator doesn't work with async functions

2019-05-21 Thread Lisa Roach
Lisa Roach added the comment: I quickly threw in Andrew's code to check it and looks like it does fix the problem. I'd be happy to add it in but I'll give @xtreak first dibs. Thanks for finding this :) -- ___ Python tracker <ht

[issue26467] Add async magic method support to unittest.mock.Mock

2019-05-20 Thread Lisa Roach
Lisa Roach added the comment: Added and AsyncMock class which supports mocking async magic methods. -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue26467] Add async magic method support to unittest.mock.Mock

2019-05-20 Thread Lisa Roach
Lisa Roach added the comment: New changeset 77b3b7701a34ecf6316469e05b79bb91de2addfa by Lisa Roach in branch 'master': bpo-26467: Adds AsyncMock for asyncio Mock library support (GH-9296) https://github.com/python/cpython/commit/77b3b7701a34ecf6316469e05b79bb91de2addfa -- nosy

[issue35924] curses segfault resizing window

2019-05-17 Thread Lisa Roach
Lisa Roach added the comment: Thank you for all the work you did on this Toshio! I think we are good to close this issue. -- stage: patch review -> resolved ___ Python tracker <https://bugs.python.org/issu

[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-05-07 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: -13094 ___ Python tracker <https://bugs.python.org/issue36674> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-05-07 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +13096 ___ Python tracker <https://bugs.python.org/issue36674> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-05-07 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +13094 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2019-04-29 Thread Lisa Roach
Lisa Roach added the comment: +1, I think tests should run the same way in debug() and run(), the difference being limited only to how the result is handled. Marking a test as skipped should still be skipped while debugging, else it pollutes the results with tests that will not run

[issue36654] Add example to tokenize.tokenize

2019-04-24 Thread Lisa Roach
Lisa Roach added the comment: This could be added to the examples section of the tokenize doc, would you want to make the PR Windson? -- nosy: +lisroach ___ Python tracker <https://bugs.python.org/issue36

[issue36541] Make lib2to3 grammar more closely match Python

2019-04-24 Thread Lisa Roach
Lisa Roach added the comment: I agree we should get lib2to3 up to date. Looks like for *args and **kwargs there is issue33348 (this has a PR) and issue32496 (no PR) and related closed issue24791 and issue24176. Adding `:=` seems straighforward to me, as for the big change maybe

[issue35924] curses segfault resizing window

2019-03-11 Thread Lisa Roach
Lisa Roach added the comment: I am able to confirm the repro, I haven't been able to find the root cause of it yet though. Trying to dig into it. -- nosy: +lisroach ___ Python tracker <https://bugs.python.org/issue35

[issue36159] Modify Formatter Class to handle arbitrary objects

2019-03-11 Thread Lisa Roach
Lisa Roach added the comment: Can you give an example use case for this? F-strings are the newer method of string interpolation, I'm not sure it's worth putting effort into adding features to string.Formatter. -- nosy: +lisroach ___ Python

[issue35132] python-gdb error: Python Exception Type does not have a target

2019-03-11 Thread Lisa Roach
Lisa Roach added the comment: New changeset 1ceb3a3d172dcf0ddff38d5d6b559443ad065b84 by Lisa Roach in branch 'master': bpo-35132: Fixes missing target in gdb pep0393 check. (GH-11848) https://github.com/python/cpython/commit/1ceb3a3d172dcf0ddff38d5d6b559443ad065b84

[issue20774] collections.deque should ship with a stdlib json serializer

2019-03-05 Thread Lisa Roach
Lisa Roach added the comment: Serhiy might be right, it looks significantly worse with benchmarking: lisroach$ python3 -m timeit "import json; json.dumps(['test'])" 10 loops, best of 3: 2.73 usec per loop lisroach$ ./python.exe -m timeit "import json; json.dumps(['test'

[issue36201] AssertCountEqual does not work for nested dictionaries.

2019-03-05 Thread Lisa Roach
Lisa Roach added the comment: I agree with Raymond, I think this might end up complicating things too much. It is common in the unit test library to only recurse one level deep and not assume too much about the intentions of the tester

[issue35132] python-gdb error: Python Exception Type does not have a target

2019-02-13 Thread Lisa Roach
Change by Lisa Roach : -- keywords: +patch pull_requests: +11879 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35132> ___ ___ Py

[issue35962] Slight error in words in [ 2.4.1. String and Bytes literals ]

2019-02-13 Thread Lisa Roach
Lisa Roach added the comment: The updated line sounds good to me, please make a PR. -- nosy: +lisroach ___ Python tracker <https://bugs.python.org/issue35

[issue21150] Add quick links table to argparse docs

2019-02-13 Thread Lisa Roach
Lisa Roach added the comment: It looks like @louielu might not be around anymore to finish this PR? If there are no objections I'd like to give a new contributor @suhearsawho a shot at this. -- nosy: +lisroach ___ Python tracker <ht

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-13 Thread Lisa Roach
Lisa Roach added the comment: New changeset 2bdd5858e3f89555c8de73a0f307d63536129dbd by Lisa Roach (Susan Su) in branch 'master': bpo-35500: align expected and actual calls on mock.assert_called_with error message. (GH-11804) https://github.com/python/cpython/commit

[issue35132] python-gdb error: Python Exception Type does not have a target

2019-01-21 Thread Lisa Roach
Lisa Roach added the comment: I experienced this bug as well and have tried to dig into it a little. I experimented with a service I have that uses shared libraries. If I compile with high level of optimizations for the C++ code (-O3) I don't experience the issue, but compiling without any

[issue35656] More matchers in unittest.mock

2019-01-10 Thread Lisa Roach
Lisa Roach added the comment: APPROXIMATE feels like it might lead to code smell to me, if I know roughly what the float should be why would I not want to test it for exactness? It could end up hiding inconsistencies the tests should be catching. -- nosy: +lisroach

[issue24209] Allow IPv6 bind in http.server

2018-11-26 Thread Lisa Roach
Change by Lisa Roach : -- stage: patch review -> resolved ___ Python tracker <https://bugs.python.org/issue24209> ___ ___ Python-bugs-list mailing list Un

[issue24209] Allow IPv6 bind in http.server

2018-11-18 Thread Lisa Roach
Lisa Roach added the comment: Looks like the original author isn't around anymore (feel free to chime in if you are, Link!), so I went ahead and made a PR. I added a quick unit test, it's not much but more than nothing, plus updated the documentation. -- nosy: +lisroach

[issue24209] Allow IPv6 bind in http.server

2018-11-18 Thread Lisa Roach
Change by Lisa Roach : -- pull_requests: +9840 stage: test needed -> patch review ___ Python tracker <https://bugs.python.org/issue24209> ___ ___ Python-

[issue35221] Enhance venv activate commands readability

2018-11-12 Thread Lisa Roach
Lisa Roach added the comment: Using plain angle brackets is common placeholder notation, and I think changing it to something different might be confusing to those who are familiar with the pattern. I have also seen plenty of people copying and pasting the wrong things because

[issue24412] setUpClass equivalent for addCleanup

2018-11-08 Thread Lisa Roach
Lisa Roach added the comment: New changeset 0f221d09cad46bee38d1b7a7822772df66c53028 by Lisa Roach in branch 'master': bpo-24412: Adds cleanUps for setUpClass and setUpModule. (GH-9190) https://github.com/python/cpython/commit/0f221d09cad46bee38d1b7a7822772df66c53028 -- nosy

  1   2   >