Skip to content

Commit

Permalink
Change test_utils to use tempfile.gettempfile() instead of /tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc committed Jun 10, 2016
1 parent aaa4344 commit ce26dc6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dbmigrator/tests/test_utils.py
Expand Up @@ -8,6 +8,7 @@

import datetime
import os.path
import tempfile
import unittest
try:
from unittest import mock
Expand Down Expand Up @@ -56,8 +57,10 @@ def test_get_settings_from_entry_points(self):
def test_get_settings_from_config(self):
from ..utils import get_settings_from_config

tmp_dir = tempfile.gettempdir()

settings = {
'migrations_directory': '/tmp/',
'migrations_directory': tmp_dir,
}

get_settings_from_config(
Expand All @@ -68,7 +71,7 @@ def test_get_settings_from_config(self):
self.assertEqual(
settings,
{'db_connection_string': testing.db_connection_string,
'migrations_directory': '/tmp/'})
'migrations_directory': tmp_dir})

def test_with_cursor(self):
from ..utils import with_cursor
Expand Down

0 comments on commit ce26dc6

Please sign in to comment.