Created
July 29, 2019 18:50
-
-
Save escapewindow/d6c33e7ab87634b5bf33135056e5748d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_foo(mocker): | |
"""Example test to change params per call to `bar`""" | |
params = [1, 2] | |
def fake_bar(): | |
param = params.pop(0) | |
# use param | |
mocker.patch.object(module, "bar", new=fake_bar) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment