All unittest.mock autospec-generated methods are coroutine functions
Open
Nobody has claimed this yet.
3.10
3.8 (EOL)
3.9 (EOL)
stdlib
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
| BPO | 41628 |
|---|---|
| Nosy | @lisroach, @tirkarthi, @twm |
| Files |
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 = None
created_at = <Date 2020-08-24.23:31:52.482>
labels = ['3.8', 'type-bug', 'library', '3.9', '3.10']
title = 'All unittest.mock autospec-generated methods are coroutine functions'
updated_at = <Date 2020-08-25.09:17:33.582>
user = 'https://github.com/twm'
bugs.python.org fields:
activity = <Date 2020-08-25.09:17:33.582>
actor = 'xtreak'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-08-24.23:31:52.482>
creator = 'twm'
dependencies = []
files = ['49425']
hgrepos = []
issue_num = 41628
keywords = []
message_count = 2.0
messages = ['375862', '375864']
nosy_count = 3.0
nosy_names = ['lisroach', 'xtreak', 'twm']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue41628'
versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']
Linked PRs
- gh-119777
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached repro4.py and inspect unittest.mock's autospec behavior for generated methods, particularly which methods are identified as coroutine functions. Compare the reproduction with existing mock behavior and tests; done means the reported autospec classification is corrected without regressing genuine coroutine methods. A linked PR is already noted in the issue, so check its status before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100