summaryrefslogtreecommitdiff
path: root/tests/utils_tests/test_autoreload.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-07-30 14:31:59 -0400
committerTim Graham <timograham@gmail.com>2014-07-30 14:31:59 -0400
commitc2ab501bab71579a9df4c927f31cfb11c131883e (patch)
treecc86131e7483dea69a2f8d482cb2c66867367b7d /tests/utils_tests/test_autoreload.py
parentd47409831fbd44739d261c32c53a094748028e4f (diff)
Fixed test failure on Windows.
os.close(fd) is needed to avoid "The process cannot access the file because it is being used by another process"
Diffstat (limited to 'tests/utils_tests/test_autoreload.py')
-rw-r--r--tests/utils_tests/test_autoreload.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/utils_tests/test_autoreload.py b/tests/utils_tests/test_autoreload.py
index c2739ce7e6..bcb7d1a448 100644
--- a/tests/utils_tests/test_autoreload.py
+++ b/tests/utils_tests/test_autoreload.py
@@ -87,11 +87,12 @@ class TestFilenameGenerator(TestCase):
self.assertFalse(any(f.endswith('.pyc') for f in gen_filenames()))
def test_deleted_removed(self):
- _, filepath = tempfile.mkstemp(dir=os.path.dirname(upath(__file__)), suffix='.py')
+ fd, filepath = tempfile.mkstemp(dir=os.path.dirname(upath(__file__)), suffix='.py')
try:
_, filename = os.path.split(filepath)
import_module('.%s' % filename.replace('.py', ''), package='utils_tests')
self.assertIn(filepath, gen_filenames())
finally:
+ os.close(fd)
os.remove(filepath)
self.assertNotIn(filepath, gen_filenames())