Skip to content

Instantly share code, notes, and snippets.

@rishabh-ink
Last active March 23, 2019 23:27
Show Gist options
  • Save rishabh-ink/addebde6856af83f9adc6cf8a29ac80a to your computer and use it in GitHub Desktop.
Save rishabh-ink/addebde6856af83f9adc6cf8a29ac80a to your computer and use it in GitHub Desktop.
from unittest import mock
import pytest
@pytest.mark.parametrize(
'ordinary_object',
[
'quill',
'cushion',
'cauldron',
],
)
def test_levitate_casts_a_spell(ordinary_object):
with mock.patch(
'levitation.cast_spell',
autospec=True,
) as patched_cast_spell:
levitate(ordinary_object)
patched_cast_spell.assert_called_once_with(target=ordinary_object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment