def test_raise(mock_makedirs, mock_isdir, caplog):
    mock_isdir.return_value = False
    mock_makedirs.side_effect = OSError
    with pytest.raises(OSError):
        mkdir_p('a/b')
    assert ([mock.call('a/b')] == mock_makedirs.call_args_list)
def test_raise(mock_makedirs, mock_isdir, caplog):
    mock_isdir.return_value = False
    mock_makedirs.side_effect = OSError
    with pytest.raises(OSError):
        mkdir_p('a/b')
    assert ([mock.call('a/b')] == mock_makedirs.call_args_list)