Bug 818777 - Switch to NamedTemporaryFile from mozfile; r=ted

This version works with Windows.
This commit is contained in:
Gregory Szorc 2012-12-20 16:11:35 -08:00
parent 9e203b6270
commit 8821ce28f8
5 changed files with 9 additions and 7 deletions

View File

@ -6,7 +6,7 @@ from __future__ import unicode_literals
import sys
import unittest
from tempfile import NamedTemporaryFile
from mozfile.mozfile import NamedTemporaryFile
from mach.config import (
AbsolutePathType,

View File

@ -5,7 +5,7 @@
import os
import unittest
from tempfile import NamedTemporaryFile
from mozfile.mozfile import NamedTemporaryFile
from mozbuild.compilation.warnings import CompilerWarning
from mozbuild.compilation.warnings import WarningsCollector
@ -221,12 +221,13 @@ class TestWarningsDatabase(unittest.TestCase):
self.assertEqual(len(warnings), 1)
self.assertEqual(warnings[0]['column'], w['column'])
# If we delete the source file, calling prune should call the warnings
# If we delete the source file, calling prune should cause the warnings
# to go away.
old_filename = source_files[0].name
source_files[0].close()
del source_files[0]
self.assertFalse(os.path.exists(old_filename))
db.prune()
self.assertEqual(len(db), 19)

View File

@ -7,7 +7,7 @@ from __future__ import unicode_literals
import os
import unittest
from tempfile import NamedTemporaryFile
from mozfile.mozfile import NamedTemporaryFile
from mach.logging import LoggingManager

View File

@ -12,9 +12,10 @@ from shutil import rmtree
from tempfile import (
gettempdir,
mkdtemp,
NamedTemporaryFile,
)
from mozfile.mozfile import NamedTemporaryFile
from mozbuild.mozconfig import (
MozconfigFindException,
MozconfigLoadException,

View File

@ -7,7 +7,7 @@ from __future__ import unicode_literals
import hashlib
import unittest
from tempfile import NamedTemporaryFile
from mozfile.mozfile import NamedTemporaryFile
from mozbuild.util import hash_file