TST clean temporary file explicitly

This commit is contained in:
Mikhail Korobov 2014-07-14 18:00:20 +06:00
parent 321a76569d
commit 2de4b8dc14
1 changed files with 4 additions and 4 deletions

View File

@ -26,10 +26,10 @@ class ProjectTest(unittest.TestCase):
rmtree(self.temp_path)
def call(self, *new_args, **kwargs):
out = tempfile.TemporaryFile()
args = (sys.executable, '-m', 'scrapy.cmdline') + new_args
return subprocess.call(args, stdout=out, stderr=out, cwd=self.cwd, \
env=self.env, **kwargs)
with tempfile.TemporaryFile() as out:
args = (sys.executable, '-m', 'scrapy.cmdline') + new_args
return subprocess.call(args, stdout=out, stderr=out, cwd=self.cwd,
env=self.env, **kwargs)
def proc(self, *new_args, **kwargs):
args = (sys.executable, '-m', 'scrapy.cmdline') + new_args