[issue41877] Check against misspellings of assert etc. in mock

2020-12-14 Thread Václav Brožek
Václav Brožek added the comment: The three PRs which landed for this bug implement what I planned in the original comment, so I'm closing this bug. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue41877] Check against misspellings of assert etc. in mock

2020-12-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset fdb9efce6ac211f973088eef508740c3fa2bd182 by vabr-g in branch 'master': bpo-41877: Check for misspelled speccing arguments (GH-23737) https://github.com/python/cpython/commit/fdb9efce6ac211f973088eef508740c3fa2bd182 --

[issue41877] Check against misspellings of assert etc. in mock

2020-12-10 Thread Václav Brožek
Václav Brožek added the comment: https://github.com/python/cpython/pull/23737 has the initial draft of the check against misspelled arguments. -- ___ Python tracker ___

[issue41877] Check against misspellings of assert etc. in mock

2020-12-10 Thread Václav Brožek
Change by Václav Brožek : -- pull_requests: +22596 pull_request: https://github.com/python/cpython/pull/23737 ___ Python tracker ___

[issue41877] Check against misspellings of assert etc. in mock

2020-12-10 Thread miss-islington
miss-islington added the comment: New changeset 9fc571359af9320fddbe4aa2710a767f168c1707 by vabr-g in branch 'master': bpo-41877: Improve docs for assert misspellings check in mock (GH-23729) https://github.com/python/cpython/commit/9fc571359af9320fddbe4aa2710a767f168c1707 -- nosy:

[issue41877] Check against misspellings of assert etc. in mock

2020-12-10 Thread Václav Brožek
Václav Brožek added the comment: https://github.com/python/cpython/pull/23729 is now a follow-up to improve docs and error message about the assert misspellings. I'm now looking at the misspelled arguments: autospec and spec_set. These are accepted by patch, patch.object and patch.multiple,

[issue41877] Check against misspellings of assert etc. in mock

2020-12-10 Thread Václav Brožek
Change by Václav Brožek : -- pull_requests: +22589 pull_request: https://github.com/python/cpython/pull/23729 ___ Python tracker ___

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Gregory P. Smith
Gregory P. Smith added the comment: Thanks for the patch! I'm leaving this open as dealing with the other aspect: * Wrong attribute names around asserts: autospect/auto_spec -> autospec, set_spec -> spec_set is still a possibility. (given you also found a number of those in our codebase

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 4662fa9bfe4a849fe87bfb321d8ef0956c89a772 by vabr-g in branch 'master': bpo-41877 Check for asert, aseert, assrt in mocks (GH-23165) https://github.com/python/cpython/commit/4662fa9bfe4a849fe87bfb321d8ef0956c89a772 --

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Gregory P. Smith
Change by Gregory P. Smith : -- assignee: -> gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Gregory P. Smith
Change by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Václav Brožek
Václav Brožek added the comment: A pull request implementing the first part of this issue (Wrong prefixes of mock asserts: asert/aseert/assrt -> assert) is at https://github.com/python/cpython/pull/23165. I acknowledge that this is a controversial topic and I put forward my reasons to carry

[issue41877] Check against misspellings of assert etc. in mock

2020-11-05 Thread Václav Brožek
Change by Václav Brožek : -- keywords: +patch pull_requests: +22077 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23165 ___ Python tracker ___

[issue41877] Check against misspellings of assert etc. in mock

2020-10-13 Thread Václav Brožek
Václav Brožek added the comment: Thank you all for the informative replies (and sorry for my long silence, I was sick). I agree that the general solution (module-level assert) is worth doing, and I just added the current motivation to https://bugs.python.org/issue24651. I still think that

[issue41877] Check against misspellings of assert etc. in mock

2020-10-08 Thread Vedran Čačić
Vedran Čačić added the comment: Of course, that's why I wrote "my" in quotes above. It's not my solution, it's the idea that many people independently had. Because it is _the_ solution, of course. :-] I'd just like to point out in the above thread (first link you provided), how _many_

[issue41877] Check against misspellings of assert etc. in mock

2020-10-08 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: See also below issues for previous discussion on making the assert helpers as top level functions : https://bugs.python.org/issue24651 https://bugs.python.org/issue30949 -- nosy: +cjw296, lisroach, mariocj89, rbcollins, xtreak

[issue41877] Check against misspellings of assert etc. in mock

2020-10-08 Thread Vedran Čačić
Vedran Čačić added the comment: Sorry, but 1) Stability policy is great when we hold on to it. If we add new spellings of assert every few years, what kind of stability it is? "My" solution is of the same type: just add one more thing to the API. But that solution is better, because a) it

[issue41877] Check against misspellings of assert etc. in mock

2020-10-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: Vedran, you explained why many use pytest instead of unittest. But we have the latter and a stability policy. I am not familiar with the existing mock code, but one already invented solution for misspelling tolerance without enumeration is the soundex

[issue41877] Check against misspellings of assert etc. in mock

2020-09-28 Thread Vedran Čačić
Vedran Čačić added the comment: It would be a valid argument if the API _worked_. Obviously, it doesn't. Every few years, the same story repeats. "We've found even more missspellings of assert, we need to add them too. They cause real bugs in our tests." I have a strong feeling it will never

[issue41877] Check against misspellings of assert etc. in mock

2020-09-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Václav, I support your suggestion and suggest that you move forward to prepare a PR. Vedran, this API has been set in stone for a long time, so changing is disruptive. If you really think the API needs to be redesigned, consider bringing it up on

[issue41877] Check against misspellings of assert etc. in mock

2020-09-28 Thread Vedran Čačić
Vedran Čačić added the comment: How about we actually _solve_ the problem, instead of masking it with layer upon layer of obfuscation? Python has standalone functions. assert_called (and company) should just be functions, they shouldn't be methods, and the problem is solved elegantly. The

[issue41877] Check against misspellings of assert etc. in mock

2020-09-28 Thread Václav Brožek
New submission from Václav Brožek : Recently we cleaned up the following typos in mocks in unittests of our codebase: * Wrong prefixes of mock asserts: asert/aseert/assrt -> assert * Wrong attribute names around asserts: autospect/auto_spec -> autospec, set_spec -> spec_set Especially the