Chris Withers added the comment:
New changeset c96127821ebda50760e788b1213975a0d5bea37f by Chris Withers
(Xtreak) in branch 'master':
bpo-36871: Ensure method signature is used when asserting mock calls to a
method (GH13261)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset be310e03d0b84ef56e9d35b0b1b21d685b7ea371 by Chris Withers (Miss
Islington (bot)) in branch '3.7':
bpo-36871: Ensure method signature is used when asserting mock calls to a
method (GH15577)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 38d311d79e57479f7a684c2cd298293033dc4990 by Chris Withers (Miss
Islington (bot)) in branch '3.8':
bpo-36871: Ensure method signature is used when asserting mock calls to a
method (GH15578)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 7397cda99795a4a8d96193d710105e77a07b7411 by Chris Withers
(Xtreak) in branch 'master':
bpo-21478: Record calls to parent when autospecced objects are used as child
with attach_mock (GH 14688)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 22fd679dc363bfcbda336775da16aff4d6fcb33f by Chris Withers (Miss
Islington (bot)) in branch '3.8':
bpo-21478: Record calls to parent when autospecced objects are used as child
with attach_mock (GH 14688) (GH-14902)
https://github.com/python
Chris Withers added the comment:
New changeset e9b187a2bfbb0586fc5d554ce745b7fe04e0b9a8 by Chris Withers (Miss
Islington (bot)) in branch '3.7':
bpo-21478: Record calls to parent when autospecced objects are used as child
with attach_mock (GH 14688) (GH-14903)
https://github.com/python
Chris Withers added the comment:
Agreed.
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Chris Withers :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue38763>
___
___
Chris Withers added the comment:
I will note that this means with:
class BaseClass(ABC):
pass
class MyDerivedClass(BaseClass):
def __init__(self, thing):
self.thing = thing
thing = MyDerivedClass()
thing now has both __slots__ and, evidently, a dict. That's a bit weird
Chris Withers added the comment:
Not sure this is correct, if an effect is an exception and requires args, then
it should be passed as an instance, not a class:
Mock(side_effect=MyException(‘foo’))
> On 10 Nov 2019, at 04:49, Karthikeyan Singaravelan
> wrote:
>
>
&
Chris Withers added the comment:
New changeset 41973c99fdfdc78315e819661e279bdcc2f058b1 by Chris Withers (Miss
Islington (bot)) in branch '3.7':
bpo-38669: patch.object now raises a helpful error (GH17511)
https://github.com/python/cpython/commit/41973c99fdfdc78315e819661e279bdcc2f058b1
Chris Withers added the comment:
New changeset 4594565b56e9c99d2d3fb7549041bbca5ecba8e2 by Chris Withers (Miss
Islington (bot)) in branch '3.8':
bpo-38669: patch.object now raises a helpful error (GH17510)
https://github.com/python/cpython/commit/4594565b56e9c99d2d3fb7549041bbca5ecba8e2
Change by Chris Withers :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
New changeset cd90a52983db34896a6335a572d55bdda274778f by Chris Withers (Elena
Oat) in branch 'master':
bpo-38669: patch.object now raises a helpful error (GH17034)
https://github.com/python/cpython/commit/cd90a52983db34896a6335a572d55bdda274778f
Chris Withers added the comment:
Surprised partials have no explicit signature:
>>> p.__signature__
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'functools.partial' object has no attribute '__signature__'
--
___
Change by Chris Withers :
--
components: +Library (Lib)
versions: +Python 3.8
___
Python tracker
<https://bugs.python.org/issue39753>
___
___
Python-bugs-list m
New submission from Chris Withers :
$ python
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from functools import part
Chris Withers added the comment:
Not sure I understand your comment.
The results of calling inpsect on a partial with bound keyword parameters are
incorrect. Furthermore, it is surprisingly that partial objects don't maintain
their own __signature__.
What is it you're suggesting
Change by Chris Withers :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
I'm not sure I like the API feel after this change: two parameters that can't
be used at the same time.
As Karthikeyan points out, this can be achieved using side_effect. Personally,
I'd prefer a PR that adds a unit test showing that this approach works
Chris Withers added the comment:
New changeset 1d0c5e16eab29d55773cc4196bb90d2bf12e09dd by Chris Withers
(Emmanuel Arias) in branch 'master':
bpo-24928: Add test case for patch.dict using OrderedDict (GH -11437)
https://github.com/python/cpython/commit
Chris Withers added the comment:
Closing in favour of issue38157.
--
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
As I said before, I can't see an additional test like this hurting, especially
if it highlights problems with earlier python versions when it's backported.
--
___
Python tracker
<https://bugs.python.org/issue24
Chris Withers added the comment:
New changeset 66b00a9d3aacf6ed49412f48743e4913104a2bb3 by Chris Withers
(Karthikeyan Singaravelan) in branch 'master':
bpo-38473: Handle autospecced functions and methods used with attach_mock
(GH-16784)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 19be85c76503535c101b38194d282187de0ff631 by Chris Withers
(Matthew Kokotovich) in branch '3.8':
[3.8] bpo-39082: Allow AsyncMock to correctly patch static/class methods
(GH-18190)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 72b1004657e60c900e4cd031b2635b587f4b280e by Chris Withers
(Karthikeyan Singaravelan) in branch 'master':
bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock
(#16029)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset a327677905956ae0b239ff430a1346dfe265709e by Carl Friedrich
Bolz-Tereick in branch 'master':
bpo-39485: fix corner-case in method-detection of mock (GH-18252)
https://github.com/python/cpython/commit/a327677905956ae0b239ff430a1346dfe265709e
Change by Chris Withers :
--
assignee: -> cjw296
___
Python tracker
<https://bugs.python.org/issue39485>
___
___
Python-bugs-list mailing list
Unsubscrib
Chris Withers added the comment:
New changeset db5e86adbce12350c26e7ffc2c6673369971a2dc by Chris Withers in
branch 'master':
Get mock coverage back to 100% (GH-18228)
https://github.com/python/cpython/commit/db5e86adbce12350c26e7ffc2c6673369971a2dc
Chris Withers added the comment:
Thank you very much for this, that was a really good catch!
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
New changeset cf0645a17acbc0c4dbbf82434e37637965748bbb by Miss Islington (bot)
in branch '3.7':
bpo-39485: fix corner-case in method-detection of mock (GH-18256)
https://github.com/python/cpython/commit/cf0645a17acbc0c4dbbf82434e37637965748bbb
Chris Withers added the comment:
New changeset 696d2324cf2a54e20e8d6a6739fa97ba815a8be9 by Miss Islington (bot)
in branch '3.8':
bpo-39485: fix corner-case in method-detection of mock (GH-18255)
https://github.com/python/cpython/commit/696d2324cf2a54e20e8d6a6739fa97ba815a8be9
Chris Withers added the comment:
I'm afraid I don't understand "immutable package which doesn't allow it's
children to be published on it", can you give an example?
--
___
Python tracker
<https://bugs.python.o
Chris Withers added the comment:
What's the real world use case for this?
--
nosy: +cjw296
___
Python tracker
<https://bugs.python.org/issue39551>
___
___
Pytho
Chris Withers added the comment:
Apologies, but I'm still not sure what "the modules are published" means?
"publish "x" as a child onto the package" also doesn't mean much to me, I'm
afraid. Are you aware of any importlib docs or some such which might be able
Chris Withers added the comment:
New changeset 032de7324e30c6b44ef272cea3be205a3d768759 by Steve Cirelli in
branch 'master':
bpo-39450 Stripped whitespace before parsing the docstring in
TestCase.shortDescription (GH-18175)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 7561e7a83f5118fda6c62fe9c8c3458f8cfd by Miss Islington (bot)
in branch '3.7':
bpo-39450 Stripped whitespace before parsing the docstring in
TestCase.shortDescription (GH-18321)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset 02395fad8e3a35ef00fa31c308693844013a1dd4 by Miss Islington (bot)
in branch '3.8':
bpo-39450 Stripped whitespace before parsing the docstring in
TestCase.shortDescription (GH-18175) (#18323)
https://github.com/python/cpython/commit
Change by Chris Withers :
--
keywords: +patch
pull_requests: +17717
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17977
___
Python tracker
<https://bugs.python.org/issu
Change by Chris Withers :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
New changeset 62865f4532094017a9b780b704686ca9734bc329 by Chris Withers
(Matthew Kokotovich) in branch 'master':
bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18116)
https://github.com/python/cpython/commit
Change by Chris Withers :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
New changeset 40c080934b3d49311209b1cb690c2ea1e04df7e7 by Chris Withers (Paulo
Henrique Silva) in branch 'master':
bpo-37955: correct mock.patch docs with respect to the returned type (GH-15521)
https://github.com/python/cpython/commit
Change by Chris Withers :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Chris Withers added the comment:
New changeset aef7dc89879d099dc704bd8037b8a7686fb72838 by Chris Withers (Vegard
Stikbakke) in branch 'master':
bpo-38932: Mock fully resets child objects on reset_mock(). (GH-17409)
https://github.com/python/cpython/commit
Chris Withers added the comment:
Hmm, the more we get into this, the less comfortable I am of the patch in the
PR.
Instead of copying and pasting more code that's likely to get out of sync,
could you change the PR to just replace _importer with the correct parts of
importlib to support
Chris Withers added the comment:
Ah right. Well, it's called `parent` in the __init__ as that's what the
attribute used to be called.
My suggestion would be to add `parent` to the docs @xtreak links to as a way to
resolve this issue
Chris Withers added the comment:
I thought we'd already changed this to _mock_parent in the last year or so?
--
___
Python tracker
<https://bugs.python.org/issue39
Chris Withers added the comment:
New changeset e553f204bf0e39b1d701a364bc71b286acb9433f by Karthikeyan
Singaravelan in branch 'master':
bpo-39915: Ensure await_args_list is updated according to the order in which
coroutines were awaited (GH-18924)
https://github.com/python/cpython/commit
Chris Withers added the comment:
New changeset f6bdac1bf718eab0cc5b6554f363f21252d245ce by Miss Islington (bot)
in branch '3.8':
bpo-39915: Ensure await_args_list is updated according to the order in which
coroutines were awaited (GH-18927)
https://github.com/python/cpython/commit
Chris Withers added the comment:
Agreed, this would be better placed in a third party library.
There's examples out there already, for example, I maintain a library [0] that
has tools for asserting about complex data structures, including flexible type
matching [1] and regex string matching
Chris Withers added the comment:
New changeset 521c8d6806adf0305c158d280ec00cca48e8ab22 by Karthikeyan
Singaravelan in branch 'master':
bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic
methods in MagicMock" (GH-19734)
https://github.com/python/cpyt
Chris Withers added the comment:
New changeset 521c8d6806adf0305c158d280ec00cca48e8ab22 by Karthikeyan
Singaravelan in branch 'master':
bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic
methods in MagicMock" (GH-19734)
https://github.com/python/cpyt
Chris Withers added the comment:
I'd go with your instincts on what to do next, I'd have a slight preference to
keeping behaviour the same as it was in 3.8 if the changes for 3.9 cause more
problems. That leaves us no worse off than we were before, and with the
opportunity to improve from
Chris Withers added the comment:
The tough one is that no-one wants an ugly sys._getframe() call, but by
avoiding it in the standard library, we force each library that needs this to
have the ugly sys._getframe() call rather than it being an unpleasant
implementation detail
New submission from Chris Withers :
Reproducer:
def test_forward_type_references(self):
def foo(a: 'Foo') -> 'Bar': pass
class Foo: pass
class Bar: pass
get_type_hints(foo)
The above gives the following exception, rather than resolving the t
Chris Withers added the comment:
Gregory, I find your response a little troubling. Myself and Karthikeyan both
do a lot of work on Mock, some might even say we're the maintainers of Mock in
both cpython's core repo and the backport.
We both feel this belongs standalone on pypi, and would
Chris Withers added the comment:
Okay, but to be up-front about this, I don't see any place in the stdlib for
any more "helpers" that could more easily be maintained on pypi and wouldn't
incur further support burden for anyone looking after this part of the standard
library.
Change by Chris Withers :
--
status: closed -> open
___
Python tracker
<https://bugs.python.org/issue40805>
___
___
Python-bugs-list mailing list
Unsubscrib
Chris Withers added the comment:
Rob, you're welcome to dump `mock` and use `unittest.mock`, and that might be
best for now, but this will then likely come back to bite you when you end up
on the version of Python, probably 3.9, where it is present
Chris Withers added the comment:
Terry, mock is now a rolling backport of unittest.mock with all development
taking place in cpython's repo. If issues are reported there, they need to be
triaged here first, as it's most likely a bug in unittest.mock that needs
fixing here.
Rob, please can
Chris Withers added the comment:
Given that `mock.patch` is being used incorrectly here, the error message seems
clear enough: It's saying there's a `Foo` object in place, and `rsplit` gives a
strong indication that a string was expected.
Would adding type hints in mock.py be a resolution
Chris Withers added the comment:
New changeset c598a04dd29b89ad072245ddaf738badcfb41ac7 by idanw206 in branch
'master':
bpo-42532: Check if NonCallableMock's spec_arg is not None instead of call its
__bool__ function (GH23613)
https://github.com/python/cpython/commit
Change by Chris Withers :
--
keywords: -easy
___
Python tracker
<https://bugs.python.org/issue3722>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Withers added the comment:
@iritkatriel - if Tim thinks this is hard, it probably is hard ;-)
--
___
Python tracker
<https://bugs.python.org/issue3
Chris Withers added the comment:
New changeset abb08e3af6aa19928007a349592e95e6de38467f by Jack DeVries in
branch 'main':
bpo-44534: fix wording and docstring sync in unittest.Mock GH27000
https://github.com/python/cpython/commit/abb08e3af6aa19928007a349592e95e6de38467f
--
nosy
Chris Withers added the comment:
I agree that this should raise an exception.
Can the two failing tests in mock's own suite be easily fixed?
--
___
Python tracker
<https://bugs.python.org/issue43
501 - 567 of 567 matches
Mail list logo