Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created March 9, 2019 18:54
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 NMZivkovic/6e44b0027408e362506f2e4d8904a5ca to your computer and use it in GitHub Desktop.
Save NMZivkovic/6e44b0027408e362506f2e4d8904a5ca to your computer and use it in GitHub Desktop.
def test_partial_mock(self):
with mock.patch.object(Rick, 'assign', return_value=333):
rick = Rick(111)
self.assertEqual(rick.assign(), 333)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment