'The temporary directory is removed even if exceptions are raised inside
the context manager.'

def test_context_manager_error(self):

    class SomeException(Exception, ):
        pass
    paths = []
    try:
        with temporary_directory() as path:
            paths.append(path)
            raise SomeException()
    except SomeException:
        [path] = paths
        self.assertFalse(path.exists())
    else:
        self.fail('Expected    exception    ``SomeException``    was    not    raised.')
