You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add samples on patch.dict of the use of decorator and in class #79866
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-09-12.11:37:38.682>created_at=<Date2019-01-08.12:37:57.375>labels= ['type-feature', '3.8', 'docs']
title='Add samples on patch.dict of the use of decorator and in class'updated_at=<Date2019-09-12.11:37:38.682>user='https://github.com/eamanu'
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.
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.
New changeset 31a82e2 by Julien Palard (Emmanuel Arias) in branch 'master': bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456) 31a82e2
Activity
eamanu commentedon Jan 8, 2019
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
JulienPalard commentedon Sep 12, 2019
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.
JulienPalard commentedon Sep 12, 2019
New changeset 31a82e2 by Julien Palard (Emmanuel Arias) in branch 'master':
bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
31a82e2
miss-islington commentedon Sep 12, 2019
New changeset 648494b by Miss Islington (bot) in branch '3.8':
bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
648494b