From c4e9615691a19128f446563718355aedf03cf01b Mon Sep 17 00:00:00 2001 From: Wei-Sheng Chin Date: Wed, 17 Jul 2019 09:08:40 -0700 Subject: [PATCH] Fix a path so that test can run on Windows --- pytorch_transformers/tests/modeling_common_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorch_transformers/tests/modeling_common_test.py b/pytorch_transformers/tests/modeling_common_test.py index 5ea98d68e2..e974ae865d 100644 --- a/pytorch_transformers/tests/modeling_common_test.py +++ b/pytorch_transformers/tests/modeling_common_test.py @@ -21,6 +21,7 @@ import os import shutil import json import random +import uuid import unittest import logging @@ -527,7 +528,7 @@ class ConfigTester(object): def create_and_test_config_to_json_file(self): config_first = self.config_class(**self.inputs_dict) - json_file_path = "/tmp/config.json" + json_file_path = os.path.join(os.getcwd(), "config_" + str(uuid.uuid4()) + ".json") config_first.to_json_file(json_file_path) config_second = self.config_class.from_json_file(json_file_path) os.remove(json_file_path)