Skip to content

Calling stub.reset() makes stub no longer override return value #47

@jonathan-benn

Description

@jonathan-benn
import sinon
import os
os.system("cd") # returns 0
stub = sinon.stub(os, "system").returns(5)
os.system("cd") # returns 5
stub.callCount # returns 1
stub.reset()
stub.callCount # returns 0
os.system("cd") # returns 0, which is wrong! should return None
stub.returns(5)
os.system("cd") # returns 0, which is wrong! should return 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions