Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version 1.1.1 breaking mocked functions. 1.0.1 works fine on same mocked functions. #267

Closed
mwick opened this issue Jul 10, 2015 · 2 comments

Comments

@mwick
Copy link

mwick commented Jul 10, 2015

mocking utils.translate_file() method in our test code (in this case) and it is producing the following stack trace (which leads to test failure):

Traceback (most recent call last):
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 1298, in patched
return func(_args, *_keywargs)
File "./ServerTypeHandler_test", line 285, in test_translate_file_failure
ph._create_host_override_file()
File "/shared/workspace/mwick/deploy/deploy/lib/servertype_handler.py", line 108, in _create_host_override_file
yaml_data = utils.translate_file(t_name, self.env)
File "", line 3, in translate_file
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 1055, in call
return _mock_self._mock_call(_args, *_kwargs)
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 1114, in _mock_call
result = next(effect)
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 126, in next
return obj.next()
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 493, in next
return next(self.obj)
File "/shared/workspace/mwick/deploy/deploy/.venv/venv/lib/python2.7/site-packages/mock/mock.py", line 127, in next
return _next(obj)
StopIteration

This works when using mock 1.0.1 for v2.7 python. We are using virtual env to install all our python libraries for testing, etc.

@rbtcollins
Copy link
Member

This might be a duplicate of #264 - the symptoms sound the same.

To verify this, it would help if you could provide a trivial example of it breaking

@mwick
Copy link
Author

mwick commented Jul 10, 2015

The bypass in #264 seems to be working. Very interesting!!! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants