def test_ioerror_if_replay_dir_creation_fails(
        mock_ensure_failure, replay_test_dir):

    with pytest.raises(IOError):
        replay.dump(
            replay_test_dir,
            'foo', {'cookiecutter': {'hello': 'world'}}
        )

    mock_ensure_failure.assert_called_once_with(replay_test_dir)
Test that replay.dump raises when the replay_dir cannot be created.
dataset/ETHPy150Open audreyr/cookiecutter/tests/replay/test_dump.py/test_ioerror_if_replay_dir_creation_fails