This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add samples on patch.dict of the use of decorator and in class
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eamanu, mdk, michael.foord, miss-islington
Priority: normal Keywords: patch, patch, patch

Created on 2019-01-08 12:37 by eamanu, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11456 merged eamanu, 2019-01-08 12:43
PR 11456 merged eamanu, 2019-01-08 12:43
PR 11456 merged eamanu, 2019-01-08 12:43
PR 16031 merged miss-islington, 2019-09-12 11:30
Messages (4)
msg333226 - (view) Author: Emmanuel Arias (eamanu) * Date: 2019-01-08 12:37
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
msg352116 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2019-09-12 11:20
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.
msg352127 - (view) Author: Julien Palard (mdk) * (Python committer) Date: 2019-09-12 11:29
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/31a82e25b6044a5b5ee25246bad3eb7b873cf5ec
msg352130 - (view) Author: miss-islington (miss-islington) Date: 2019-09-12 11:37
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/648494b44aad273590382c8db5a9d1a6c96ee67a
History
Date User Action Args
2022-04-11 14:59:10adminsetgithub: 79866
2019-09-12 11:37:38mdksetkeywords: patch, patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-12 11:37:08miss-islingtonsetnosy: + miss-islington
messages: + msg352130
2019-09-12 11:30:07miss-islingtonsetpull_requests: + pull_request15654
2019-09-12 11:29:57mdksetmessages: + msg352127
2019-09-12 11:20:09mdksetkeywords: patch, patch, patch
nosy: + mdk
messages: + msg352116

2019-01-08 12:43:31eamanusetkeywords: + patch
stage: patch review
pull_requests: + pull_request10961
2019-01-08 12:43:24eamanusetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10960
2019-01-08 12:43:17eamanusetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10959
2019-01-08 12:37:57eamanucreate