To test for a specific exception in unit testing, use pytest.raises.
pytest.raises
For example, you can use it to test if a ValueError is thrown when there are NaN values in the group column.
ValueError
Simulate External Services in Testing with Mock Objects
Validating Polars DataFrames with Pandera
Pandera: Data Validation Made Simple for Python DataFrames
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Δ