The old @pytest.yield_fixture causes a deprecation warning: Use @pytest.fixture instead; they are the same. def records():