def METHOD_NAME(self):
    """
    Tests the automatic closing/deleting of NamedTemporaryFile using the
    context manager.
    """
    content = b"burn after writing"
    # write something to tempfile and check closing/deletion afterwards
    with NamedTemporaryFile() as tf:
        filename = tf.name
        tf.write(content)
    assert not os.path.exists(filename)
    # write something to tempfile and check that it is written correctly
    with NamedTemporaryFile() as tf:
        filename = tf.name
        tf.write(content)
        tf.close()
        with open(filename, 'rb') as fh:
            tmp_content = fh.read()
    assert content == tmp_content
    assert not os.path.exists(filename)
    # check that closing/deletion works even when nothing is done with file
    with NamedTemporaryFile() as tf:
        filename = tf.name
    assert not os.path.exists(filename)