derwiki-adroll / mock

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

deepcopying property of mock with spec breaks mocked calls #235

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Execute the attached script
2. Watch in horror
3. ???
4. Profit

What is the expected output? What do you see instead?
Assertion in line 14 should pass, instead I get the following exception:
Traceback (most recent call last):
  File "mock_error.py", line 14, in <module>
    assert 1 == copy.nested_property()
  File "/home/sir/.virtualenvs/issue/local/lib/python2.7/site-packages/mock.py", line 955, in __call__
    return _mock_self._mock_call(*args, **kwargs)
  File "/home/sir/.virtualenvs/issue/local/lib/python2.7/site-packages/mock.py", line 997, in _mock_call
    _new_parent.mock_calls.append(this_mock_call)
AttributeError: 'TestClass' object has no attribute 'mock_calls'

What version of the product are you using? On what operating system?
mock==1.0.1
python==2.7.3
ubuntu precise (Ubuntu 12.04.4 LTS)

Please provide any additional information below.

Original issue reported on code.google.com by heidarli...@gmail.com on 11 Jul 2014 at 1:54

Attachments: