Skip to content

Commit 793c9b9

Browse files
committed
[test] Fix windows fail samplefile test
1 parent 7b95929 commit 793c9b9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/test_samplefile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import sys
66
import re
7+
import tempfile
78

89
from odml.info import FORMAT_VERSION
910
from odml.tools import xmlparser
@@ -357,9 +358,11 @@ def test_get_property_by_path(self):
357358
self.assertRaises(ValueError, sec1.get_property_by_path, wrongpath)
358359

359360
def test_save_version(self):
361+
tmp_file = os.path.join(tempfile.gettempdir(), "example.odml")
362+
360363
self.doc.version = '2.4'
361364
writer = xmlparser.XMLWriter(self.doc)
362-
writer.write_file("/tmp/example.odml")
365+
writer.write_file(tmp_file)
363366

364-
restored = xmlparser.load("/tmp/example.odml")
367+
restored = xmlparser.load(tmp_file)
365368
self.assertEqual(self.doc.version, restored.version)

0 commit comments

Comments
 (0)