[issue35685] Add samples on patch.dict of the use of decorator and in class
New submission from Emmanuel Arias <emmanuelarias30@gmail.com>: Hi! I create this PR to add a samples of the use of patch.dict with decorator on method and class. I think that is a good improve because the doc mentions the use of patch.dict with decorator on method and class but don't show any samples. Other, question, why on unittest.mock documentation is used `assert *something* == *something*` and it is not used the assertEquals (and others)? IMHO this would be better for unittest docs. Regards ---------- assignee: docs@python components: Documentation messages: 333226 nosy: docs@python, eamanu, michael.foord priority: normal severity: normal status: open title: Add samples on patch.dict of the use of decorator and in class type: enhancement versions: Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Change by Emmanuel Arias <emmanuelarias30@gmail.com>: ---------- keywords: +patch pull_requests: +10959 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Change by Emmanuel Arias <emmanuelarias30@gmail.com>: ---------- keywords: +patch, patch pull_requests: +10959, 10960 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Change by Emmanuel Arias <emmanuelarias30@gmail.com>: ---------- keywords: +patch, patch, patch pull_requests: +10959, 10960, 10961 stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Julien Palard <julien+python@palard.fr> added the comment: We're using assert instead of assertEqual to denote that we're not "testing unittest" but asserting that unittest work as documented. Whch is semantically a bit different. Unittesting unittest using unittest works, but using unittest test to test unittest as documentation example could lead the reader to having hard time figuring what's what. I think using assert here disambiguate the whole thing. ---------- nosy: +mdk _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Julien Palard <julien+python@palard.fr> added the comment: New changeset 31a82e25b6044a5b5ee25246bad3eb7b873cf5ec by Julien Palard (Emmanuel Arias) in branch 'master': bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456) https://github.com/python/cpython/commit/31a82e25b6044a5b5ee25246bad3eb7b873... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +15654 pull_request: https://github.com/python/cpython/pull/16031 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 648494b44aad273590382c8db5a9d1a6c96ee67a by Miss Islington (bot) in branch '3.8': bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456) https://github.com/python/cpython/commit/648494b44aad273590382c8db5a9d1a6c96... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
Change by Julien Palard <julien+python@palard.fr>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue35685> _______________________________________
participants (3)
-
Emmanuel Arias
-
Julien Palard
-
miss-islington