Skip to content

Commit 0e59777

Browse files
committed
Create tempfile in a cross-platform way
1 parent c9c36d6 commit 0e59777

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_revert_command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import os
18+
import tempfile
1819
import unittest
1920

2021
from datetime import date
@@ -47,8 +48,8 @@ def setUp(self):
4748

4849
self.tmp_name = str(uuid4().hex.upper()[0:6])
4950

50-
archive_filename = '/tmp/' + self.tmp_name + '_archive'
51-
todo_filename = '/tmp/' + self.tmp_name + '_todo'
51+
archive_filename = tempfile.gettempdir() + os.sep + self.tmp_name + '_archive'
52+
todo_filename = tempfile.gettempdir() + os.sep + self.tmp_name + '_todo'
5253

5354
config(p_overrides={('topydo', 'archive_filename'): archive_filename,
5455
('topydo', 'filename'): todo_filename, ('topydo', 'backup_count'): '5'})

0 commit comments

Comments
 (0)