Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mock
>>> import select
>>> select.select([1], [1,2], [1])
([], [1, 2], [])
>>> sel = select.select
>>> select.select = mock.Mock()
>>> select.select([1], [1,2], [1])
<Mock name='mock()' id='140593171640528'>
>>> select.select.return_value
<Mock name='mock()' id='140593171640528'>
>>> select.select.return_value = "fred"
>>> select.select()
'fred'
>>> select.select.return_value = ([], [1,2], [])
>>> select.select([1], [1,2], [1])
([], [1, 2], [])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.