You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_set_backend.py 530 B

1234567891011121314151617
  1. import os
  2. from fastNLP.envs.set_env import dump_fastnlp_backend
  3. from tests.helpers.utils import Capturing
  4. from fastNLP.core import synchronize_safe_rm
  5. def test_dump_fastnlp_envs():
  6. filepath = None
  7. try:
  8. with Capturing() as output:
  9. dump_fastnlp_backend()
  10. filepath = os.path.join(os.path.expanduser('~'), '.fastNLP', 'envs', os.environ['CONDA_DEFAULT_ENV']+'.json')
  11. assert filepath in output[0]
  12. assert os.path.exists(filepath)
  13. finally:
  14. synchronize_safe_rm(filepath)