[issue40133] Provide additional matchers for unittest.mock

2020-10-19 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

based on the reaction from those who own mock at this point, i'm going to close 
this.  shipping more handy mock matchers with mock makes sense to me as they 
belong together.  but i'm not willing to argue it if anyone thinks it'll be a 
maintenance burden within the stdlib.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-06-23 Thread Chris Withers


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.

The only "helper" in the section you refer to is 
https://docs.python.org/3/library/unittest.mock.html#mock-open which I'd 
consider vestigal and a bit of a maintenance magnet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-06-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I suggest waiting to see what I come up with as a proposal for what part(s) of 
this makes sense in the stdlib and why.  I've closed the PR.

Nothing is going to be added to mock without your agreement.

This issue is not a high priority for me, but leaving it open and assigned to 
me as reminder helps keep the TODO of whittling the proposal down with 
justifications on my radar.

--
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-06-18 Thread Chris Withers


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 prefer not to see this 
merged.

"We've been using these internally at Google for years" is not a compelling 
argument and suggests you already have a viable solution which doesn't involve 
merging these into the core repo. Your phrasing could be interpreted as 
somewhat bullying - "it's right for Google, so I'm going to do it for all of 
Python in spite of comments from other core contributors, and I don't want to 
discuss this on a mailing list because that will take too long".

Please consider re-closing this issue and respecting the decisions of those of 
us who maintain mock long-term. If not, please suggest a way forward to mediate 
this disagreement, but please do not unilaterally merge anything without 
sorting this out first.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-05-29 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-05-23 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I disagree.  Many of these do belong in the stdlib and we don't need a 
python-ideas bike shedding 300 message thread about something so trivial.

We've been using these internally at Google for years.

Its on my plate to identify which ones to accept and get the most used useful 
ones in.  With an additional eye to which ones we'd likely use when testing the 
stdlib itself.

They fit right in with 
https://docs.python.org/3/library/unittest.mock.html#helpers

--
assignee:  -> gregory.p.smith
resolution: rejected -> 
status: closed -> open
versions: +Python 3.10 -Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-05-23 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@Flameeyes, thank you for the suggestion.  As per the other comments, I'm going 
to close this as it would be more suitable to have it on PyPI.  Feel free to 
have more discussion here or on python-ideas if you want to get more feedback.

--
nosy: +cheryl.sabella
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-16 Thread Chris Withers


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 [2].

[0] 
https://testfixtures.readthedocs.io/en/latest/comparing.html#the-compare-function
[1] 
https://testfixtures.readthedocs.io/en/latest/comparing.html#comparison-objects
[2] 
https://testfixtures.readthedocs.io/en/latest/comparing.html#string-comparison-objects

Diego, would you be okay if we closed this issue and the accompanying pull 
request?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks for the idea. But given the size of the patch and benefit it provides 
for the code I feel it could be a better idea to have it in PyPI and then add 
it to stdlib later once it gathers more feedback and adoption. Adding others 
for more feedback.

--
nosy: +cjw296, lisroach, mariocj89, michael.foord

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-02 Thread Diego Elio Pettenò

Change by Diego Elio Pettenò :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-02 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +18673
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19310

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-01 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40133] Provide additional matchers for unittest.mock

2020-04-01 Thread Diego Elio Pettenò

New submission from Diego Elio Pettenò :

The unittest.mock `assert_called_*with*` methods take either literals, or the 
single `ANY` special matcher 
(https://docs.python.org/3/library/unittest.mock.html#any) to match any 
argument.

Experience suggests me that it's useful to have more flexible matchers, such as 
INSTANCEOF or REGEXP.

Will provide a starting pull request for this today. (Be warned: it's the first 
time I try contributing to CPython.)

--
components: Tests
messages: 365457
nosy: Diego Elio Pettenò
priority: normal
severity: normal
status: open
title: Provide additional matchers for unittest.mock
type: enhancement
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com