python/tests/utils.py: add get_tmp_sink_name
authorPaul Brossier <piem@piem.org>
Sun, 23 Feb 2014 17:21:25 +0000 (14:21 -0300)
committerPaul Brossier <piem@piem.org>
Sun, 23 Feb 2014 17:21:25 +0000 (14:21 -0300)
python/tests/utils.py

index 79a0952..8212cbd 100644 (file)
@@ -19,6 +19,13 @@ def get_default_test_sound(TestCase, rel_dir = 'sounds'):
     else:
         return all_sounds[0]
 
+def get_tmp_sink_name():
+    from tempfile import mkstemp
+    import os
+    fd, name = mkstemp()
+    os.close(fd)
+    return name
+
 def array_from_yaml_file(filename):
     import yaml
     f = open(filename)