sorenisanerd / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Mock is not a spy #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. The official documentation suggests that 
http://www.voidspace.org.uk/python/mock/ is a Spy
2. Create a test:

realObject = MyClass()
realObject.realMethod = Mock(realObject.realMethod)
realObject.realMethod()

What is the expected output? What do you see instead?

I expect that realObject.realMethod is called, i.e. Mock is a real spy (not a 
stub)

What version of the product are you using? On what operating system?

1.0.0

Please provide any additional information below.

Is is expected behaviour, or am I doing something wrong?

Original issue reported on code.google.com by Van...@gmail.com on 11 Oct 2012 at 1:13

GoogleCodeExporter commented 9 years ago
You need the "wraps" keyword option to mocks.

Original comment by fuzzyman on 11 Oct 2012 at 1:14