import pytest @pytest.fixture def data(data_type, pdf): if data_type == "pdf": return pdf elif data_type == "bytestring": return "content".encode("latin1") @pytest.fixture def data_items(item_type): if item_type == "string": return iter([b"content"] * 4)