Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sivabudh
Created September 27, 2016 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sivabudh/0cb53bfbcd3b96a43a3b40fd447a526e to your computer and use it in GitHub Desktop.
Save sivabudh/0cb53bfbcd3b96a43a3b40fd447a526e to your computer and use it in GitHub Desktop.
A fucking useless test
def foo(x):
y = _bar(x)
z = _baz(x, y)
x.frob = bling
return x
def test_foo():
with mock.patch('path.to.foopy._bar', return_value=1) as bar, mock.patch('path.to.foopy._baz', return_value=2) as baz:
zip = foo(5)
assert bar.called_once_with(5)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment