How to create Abstract Test aka Contract Test using pytest fixtures Posted on 2015-09-20 in dev • Tagged with Python, pytest, test The solution I came up with: import pytest def square(num): return num * num def recursive_map(f, _list): """Recusive map implementation.""" if not _list: return [] else: head, *tail = _list h = [f(head)] h.extend(recursive_map(f, tail)) return h class MapContract(object): @pytest.fixture def a_map(self): raise NotImplementedError('Not ... Continue reading