- Build the DataFrame outside the `pytest.raises` block so only the call under test can raise the expected ValueError.