pytest-dev / pytest-dev/pytest-mock
mocker.stub() is a coroutine function
Open
Nobody has claimed this yet.
question
- Dominant language
- Python
- Stars
- 2k
- Forks
- 173
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 6
Description
def test_icf_sync(mocker):
func = mocker.stub('func')
assert not inspect.iscoroutinefunction(func)
def test_icf_async(mocker):
func = mocker.async_stub('func')
assert inspect.iscoroutinefunction(func)
Expected: mocker.stub() returns something that doesn't resemble a coroutine.
Observed: mocker.stub() is detected as a coroutine.
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 by running the two reproducer tests in the issue and inspect the implementations of mocker.stub() and mocker.async_stub(). Done means mocker.stub() is not detected as a coroutine function while mocker.async_stub() still is.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100