From a6b8ee19b85bbd798510191f0aee596f36b909d2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 2 Jun 2015 20:44:03 -0700 Subject: test: create temp dir in common.js Move creation of temporary directories for tests out of the Python harness and into common.js. This allows all tests to be run reliably outside of the Python wrapper. PR-URL: https://github.com/nodejs/io.js/pull/1877 Reviewed-By: Rod Vagg Reviewed-By: Jeremiah Senkpiel --- test/testpy/__init__.py | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'test/testpy') diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index a1b89898fe..5933f8b9b6 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -28,7 +28,6 @@ import test import os import shutil -from shutil import rmtree from os import mkdir from glob import glob from os.path import join, dirname, exists @@ -50,35 +49,6 @@ class SimpleTestCase(test.TestCase): self.tmpdir = join(dirname(self.config.root), 'tmp') self.additional_flags = additional - def GetTmpDir(self): - return "%s.%d" % (self.tmpdir, self.thread_id) - - - def AfterRun(self, result): - # delete the whole tmp dir - try: - rmtree(self.GetTmpDir()) - except: - pass - # make it again. - try: - mkdir(self.GetTmpDir()) - except: - pass - - def BeforeRun(self): - # delete the whole tmp dir - try: - rmtree(self.GetTmpDir()) - except: - pass - # make it again. - # intermittently fails on win32, so keep trying - while not os.path.exists(self.GetTmpDir()): - try: - mkdir(self.GetTmpDir()) - except: - pass def GetLabel(self): return "%s %s" % (self.mode, self.GetName()) -- cgit v1.2.3