We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9b2024 commit 0c257c9Copy full SHA for 0c257c9
test/util.py
@@ -5,3 +5,21 @@
5
import tempfile
6
7
ODML_CACHE_DIR = os.path.join(tempfile.gettempdir(), "odml.cache")
8
+
9
+TEST_TEMP_DIR = os.path.join(tempfile.gettempdir(), "odml_test")
10
+if not os.path.exists(TEST_TEMP_DIR):
11
+ os.mkdir(TEST_TEMP_DIR)
12
13
14
+def create_test_dir(script_name):
15
+ """
16
+ Takes the name of a test script and creates a like-named directory
17
+ in the main test directory if it does not yet exist.
18
19
+ :param script_name: String that will be used to create the test directory
20
21
+ :return: Path to the test directory.
22
23
+ dir_name = "_%s" % os.path.basename(os.path.splitext(script_name)[0])
24
25
+ return tempfile.mkdtemp(suffix=dir_name, dir=TEST_TEMP_DIR)
0 commit comments