Skip to content

Instantly share code, notes, and snippets.

@rhizoome
Created November 30, 2017 20:36
Show Gist options
  • Save rhizoome/22634f259f4d6cda669e2dba51390f6b to your computer and use it in GitHub Desktop.
Save rhizoome/22634f259f4d6cda669e2dba51390f6b to your computer and use it in GitHub Desktop.
import pytest
from hypothesis import given
from hypothesis.strategies import text, lists
def func(x):
print(x)
class TestPerson():
@pytest.fixture(autouse=True)
def setup_testdata(self):
print("bla")
@given(lists(text()))
def test_test(self, mocker, list_):
mock_func = mocker.patch('bla.test_test.func')
func(list_)
assert mock_func.call_count == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment