Commit c9712ebc authored by Tarek Ziadé's avatar Tarek Ziadé

Fixed #6131: test_modulefinder leaked when run after test_distutils

parent 3917b17a
...@@ -22,16 +22,14 @@ class BuildDumbTestCase(support.TempdirManager, ...@@ -22,16 +22,14 @@ class BuildDumbTestCase(support.TempdirManager,
unittest.TestCase): unittest.TestCase):
def setUp(self): def setUp(self):
support.TempdirManager.setUp(self) super(BuildDumbTestCase, self).setUp()
support.LoggingSilencer.setUp(self)
self.old_location = os.getcwd() self.old_location = os.getcwd()
self.old_sys_argv = sys.argv[:] self.old_sys_argv = sys.argv[:]
def tearDown(self): def tearDown(self):
os.chdir(self.old_location) os.chdir(self.old_location)
sys.argv = self.old_sys_argv[:] sys.argv = self.old_sys_argv[:]
support.LoggingSilencer.tearDown(self) super(BuildDumbTestCase, self).tearDown()
support.TempdirManager.tearDown(self)
def test_simple_built(self): def test_simple_built(self):
......
...@@ -18,7 +18,7 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase): ...@@ -18,7 +18,7 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
self._logs.append(msg) self._logs.append(msg)
def setUp(self): def setUp(self):
support.TempdirManager.setUp(self) super(DirUtilTestCase, self).setUp()
self._logs = [] self._logs = []
tmp_dir = self.mkdtemp() tmp_dir = self.mkdtemp()
self.root_target = os.path.join(tmp_dir, 'deep') self.root_target = os.path.join(tmp_dir, 'deep')
...@@ -29,7 +29,7 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase): ...@@ -29,7 +29,7 @@ class DirUtilTestCase(support.TempdirManager, unittest.TestCase):
def tearDown(self): def tearDown(self):
log.info = self.old_log log.info = self.old_log
support.TempdirManager.tearDown(self) super(DirUtilTestCase, self).tearDown()
def test_mkpath_remove_tree_verbosity(self): def test_mkpath_remove_tree_verbosity(self):
......
...@@ -16,7 +16,7 @@ class FileUtilTestCase(support.TempdirManager, unittest.TestCase): ...@@ -16,7 +16,7 @@ class FileUtilTestCase(support.TempdirManager, unittest.TestCase):
self._logs.append(msg) self._logs.append(msg)
def setUp(self): def setUp(self):
support.TempdirManager.setUp(self) super(FileUtilTestCase, self).setUp()
self._logs = [] self._logs = []
self.old_log = log.info self.old_log = log.info
log.info = self._log log.info = self._log
...@@ -27,7 +27,7 @@ class FileUtilTestCase(support.TempdirManager, unittest.TestCase): ...@@ -27,7 +27,7 @@ class FileUtilTestCase(support.TempdirManager, unittest.TestCase):
def tearDown(self): def tearDown(self):
log.info = self.old_log log.info = self.old_log
support.TempdirManager.tearDown(self) super(FileUtilTestCase, self).tearDown()
def test_move_file_verbosity(self): def test_move_file_verbosity(self):
f = open(self.source, 'w') f = open(self.source, 'w')
......
...@@ -66,7 +66,7 @@ class FakeOpener(object): ...@@ -66,7 +66,7 @@ class FakeOpener(object):
class RegisterTestCase(PyPIRCCommandTestCase): class RegisterTestCase(PyPIRCCommandTestCase):
def setUp(self): def setUp(self):
PyPIRCCommandTestCase.setUp(self) super(RegisterTestCase, self).setUp()
# patching the password prompt # patching the password prompt
self._old_getpass = getpass.getpass self._old_getpass = getpass.getpass
def _getpass(prompt): def _getpass(prompt):
...@@ -78,7 +78,7 @@ class RegisterTestCase(PyPIRCCommandTestCase): ...@@ -78,7 +78,7 @@ class RegisterTestCase(PyPIRCCommandTestCase):
def tearDown(self): def tearDown(self):
getpass.getpass = self._old_getpass getpass.getpass = self._old_getpass
urllib2.build_opener = self.old_opener urllib2.build_opener = self.old_opener
PyPIRCCommandTestCase.tearDown(self) super(RegisterTestCase, self).tearDown()
def _get_cmd(self, metadata=None): def _get_cmd(self, metadata=None):
if metadata is None: if metadata is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment