docstr: 测试 path 是一个文件的地址，但是这个文件所在的文件夹不存在；
docstr_tok: ["\u6d4b\u8bd5","path","\u662f\u4e00\u4e2a\u6587\u4ef6\u7684\u5730\u5740\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u5939\u4e0d\u5b58\u5728\uff1b"]
code: def test_add_file_2(self):
      """
      测试 path 是一个文件的地址，但是这个文件所在的文件夹不存在；
      """
      origin_path = Path(tempfile.mkdtemp())
  
      try:
          path = origin_path.joinpath("not_existed")
          path = path.joinpath("log.txt")
          handler = logger.add_file(path)
          logger.info(self.msg)
          with open(path, "r") as f:
              line = "".join([l for l in f])
          assert self.msg in line
      finally:
          rank_zero_rm(origin_path)
  
imports: import os
  import tempfile
  import datetime
  from pathlib import Path
  import logging
  import re
  import pytest
  from fastNLP.envs.env import FASTNLP_LAUNCH_TIME
  from fastNLP.envs.distributed import rank_zero_rm
  from fastNLP.core.log.logger import logger
  from tests.helpers.utils import magic_argv_env_context, recover_logger
label_desc: Use image node_id 2 for calling the TestLogger obj's underlying member method code with example usage: obj.test_add_file_2() without return types