Merged revisions 76042 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76042 | tarek.ziade | 2009-11-01 23:33:45 +0100 (Sun, 01 Nov 2009) | 1 line fixed stdout alteration in test_distutils ........
This commit is contained in:
parent
fd0680b19d
commit
2f9197f955
|
@ -69,6 +69,7 @@ class BuildPyTestCase(support.TempdirManager,
|
||||||
open(os.path.join(testdir, "testfile"), "w").close()
|
open(os.path.join(testdir, "testfile"), "w").close()
|
||||||
|
|
||||||
os.chdir(sources)
|
os.chdir(sources)
|
||||||
|
old_stdout = sys.stdout
|
||||||
sys.stdout = io.StringIO()
|
sys.stdout = io.StringIO()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -87,7 +88,7 @@ class BuildPyTestCase(support.TempdirManager,
|
||||||
finally:
|
finally:
|
||||||
# Restore state.
|
# Restore state.
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
sys.stdout = sys.__stdout__
|
sys.stdout = old_stdout
|
||||||
|
|
||||||
def test_dont_write_bytecode(self):
|
def test_dont_write_bytecode(self):
|
||||||
# makes sure byte_compile is not used
|
# makes sure byte_compile is not used
|
||||||
|
|
|
@ -60,6 +60,8 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
||||||
util.find_executable = self._find_executable
|
util.find_executable = self._find_executable
|
||||||
self._exes = {}
|
self._exes = {}
|
||||||
self.old_popen = subprocess.Popen
|
self.old_popen = subprocess.Popen
|
||||||
|
self.old_stdout = sys.stdout
|
||||||
|
self.old_stderr = sys.stderr
|
||||||
FakePopen.test_class = self
|
FakePopen.test_class = self
|
||||||
subprocess.Popen = FakePopen
|
subprocess.Popen = FakePopen
|
||||||
|
|
||||||
|
@ -79,6 +81,8 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
|
||||||
sysconfig._config_vars = copy(self._config_vars)
|
sysconfig._config_vars = copy(self._config_vars)
|
||||||
util.find_executable = self.old_find_executable
|
util.find_executable = self.old_find_executable
|
||||||
subprocess.Popen = self.old_popen
|
subprocess.Popen = self.old_popen
|
||||||
|
sys.old_stdout = self.old_stdout
|
||||||
|
sys.old_stderr = self.old_stderr
|
||||||
super(UtilTestCase, self).tearDown()
|
super(UtilTestCase, self).tearDown()
|
||||||
|
|
||||||
def _set_uname(self, uname):
|
def _set_uname(self, uname):
|
||||||
|
|
Loading…
Reference in New Issue