def METHOD_NAME(mode, exception):
    """
    Ensure the DeferredFileWriter raises an appropriate error for unknown file
    modes
    """
    writer = DeferredFileWriter()
    with pytest.raises(exception):
        writer.open('somefile.txt', mode)