def METHOD_NAME(tmpdir, monkeypatch):
    monkeypatch.chdir(tmpdir)
    path = Path('file.txt')
    writer = DeferredFileWriter()
    with writer.open(path, 'w') as file:
        file.write('Hello!')
    # Close file
    with writer.open(path, 'r') as file:
        assert file.read() == 'Hello!'