← 输入框|github.com|刷新
Skip to content

Add samples on patch.dict of the use of decorator and in class #79866

Closed

Description

@eamanu
mannequin
BPO 35685
Nosy @voidspace, @JulienPalard, @eamanu, @miss-islington
PRs
  • bpo-35685: Add examples of unittest.mock.patch.dict usage #11456
  • bpo-35685: Add examples of unittest.mock.patch.dict usage #11456
  • bpo-35685: Add examples of unittest.mock.patch.dict usage #11456
  • [3.8] bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456) #16031
  • 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 = None
    closed_at = <Date 2019-09-12.11:37:38.682>
    created_at = <Date 2019-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 = <Date 2019-09-12.11:37:38.682>
    user = 'https://github.com/eamanu'

    bugs.python.org fields:

    activity = <Date 2019-09-12.11:37:38.682>
    actor = 'mdk'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2019-09-12.11:37:38.682>
    closer = 'mdk'
    components = ['Documentation']
    creation = <Date 2019-01-08.12:37:57.375>
    creator = 'eamanu'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35685
    keywords = ['patch', 'patch', 'patch']
    message_count = 4.0
    messages = ['333226', '352116', '352127', '352130']
    nosy_count = 5.0
    nosy_names = ['michael.foord', 'docs@python', 'mdk', 'eamanu', 'miss-islington']
    pr_nums = ['11456', '11456', '11456', '16031']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35685'
    versions = ['Python 3.8']

    Activity

    1. eamanu commented on Jan 8, 2019

      eamanumannequin
      MannequinAuthor

      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

    2. added
      docs
      type-feature
      on Jan 8, 2019
    3. JulienPalard commented on Sep 12, 2019

      @JulienPalard
      Member

      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.

    4. JulienPalard commented on Sep 12, 2019

      @JulienPalard
      Member

      New changeset 31a82e2 by Julien Palard (Emmanuel Arias) in branch 'master':
      bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
      31a82e2

    5. miss-islington commented on Sep 12, 2019

      @miss-islington
      Contributor

      New changeset 648494b by Miss Islington (bot) in branch '3.8':
      bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
      648494b

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.8 (EOL)docstype-feature

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions