mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Merged revisions 75485 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75485 | tarek.ziade | 2009-10-18 11:28:26 +0200 (Sun, 18 Oct 2009) | 1 line Changed distutils tests to avoid environment alteration ........
This commit is contained in:
parent
ccb3c0946c
commit
430fb63dd2
13 changed files with 66 additions and 34 deletions
|
@ -8,7 +8,7 @@ import sys
|
|||
import test.support
|
||||
from test.support import captured_stdout
|
||||
import unittest
|
||||
|
||||
from distutils.tests import support
|
||||
|
||||
# setup script that uses __file__
|
||||
setup_using___file__ = """\
|
||||
|
@ -29,17 +29,20 @@ setup()
|
|||
"""
|
||||
|
||||
|
||||
class CoreTestCase(unittest.TestCase):
|
||||
class CoreTestCase(support.EnvironGuard, unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(CoreTestCase, self).setUp()
|
||||
self.old_stdout = sys.stdout
|
||||
self.cleanup_testfn()
|
||||
self.old_argv = sys.argv[:]
|
||||
self.old_argv = sys.argv, sys.argv[:]
|
||||
|
||||
def tearDown(self):
|
||||
sys.stdout = self.old_stdout
|
||||
self.cleanup_testfn()
|
||||
sys.argv = self.old_argv[:]
|
||||
sys.argv = self.old_argv[0]
|
||||
sys.argv[:] = self.old_argv[1]
|
||||
super(CoreTestCase, self).tearDown()
|
||||
|
||||
def cleanup_testfn(self):
|
||||
path = test.support.TESTFN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue