[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 ___ Pytho

[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 <https://bugs.python.org/issue41

[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 <https://bugs.python.org/issue41

[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 <https://bugs.python.org/issue41

[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 ca

[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 <https://bugs.python.org/issu

[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

[issue24651] Mock.assert* API is in user namespace

2020-10-13 Thread Václav Brožek
Václav Brožek added the comment: As for the assert misspellings raising AttributeError -- that's not true of all of them, only those starting with "assret" or "assert" [1]. In my company, we recently cleaned up a bunch of other assert-misspellings, including cases where a

[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 E