Use pytest.raises.